Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [performance]

Questions related to improving application performance, this can be range from selection software architecture to selection of algorithms.

-2
votes
0answers
33 views

What steps could improve the throughput of this system? [closed]

I got this question on an interview (Codility) the other day. Imagine we have a system responsible for counting the total number of pages on a web site. It's a single process on a single machine,...
8
votes
1answer
327 views

How can I optimize a program's performance when no profiling tools are available?

I am currently working on an OpenGl program whose performance I would like to improve. The performance is okay but not ideal on powerful dedicated GPUs, but is abysmal on integrated graphics (< 10 ...
-3
votes
1answer
50 views

Can accessing the same API from different languages be more performant?

I've just started my first proper internship in industry (not learning to code but learning to write software that does stuff). My employer makes use of Apache Spark, as they do a lot of Big Data ...
0
votes
2answers
155 views

Best way to match timezone with time offset?

I have a c# solution which uses mssql database to store data. In my database there is a big table of entities (e.g. accounts) for each of which the TimezoneId field is defined. This field is filled ...
1
vote
1answer
131 views

Avoiding instantiating the whole application at startup when using a composition root

In a typical non-DI application, when you enter a section of code the necessary objects are constructed and when you leave it they are deconstructed. However, when doing dependency injection with a ...
0
votes
1answer
93 views

Is my understanding of modern IDEs autosave feature naive? [duplicate]

Long time ago I learned that text files are not like Random access Files, i. e., adding or updating info at the beginning of a text file involves moving all the rest of the file "forward" (or ...
2
votes
1answer
197 views

Is there such a thing as linking to too many dynamic libraries in Linux?

I'm currently considering breaking down one of my libraries in some 20 Debian sub-projects. Each part is already pretty much a standalone bit in the existing large library. What I'm wondering is the ...
0
votes
1answer
85 views

How large-scale production web crawlers improve performance when it comes to running into already visited links

I have built a very basic webcrawler running off my laptop so it has limited memory and limited hard drive space. The way I have it now is I'm using MongoDB to store the links I find on pages. I make ...
2
votes
1answer
68 views

Calculation On Large File Data

I have a task where I need to read a big data file and process the data in it. Every row in the file looks like this: CustomerId ItemId Amount Price I need to calculate the total cost for the ...
0
votes
2answers
90 views

performance suggestions on Aggregate root containing thousands of child entities

I understand that DDD is a design concept and implementation through ORMs are tricky but help me understand how would you solve this problem? So here is my confusion on changing on aggregates only ...
0
votes
0answers
59 views

DDD: aggregate root and references to child entities

I'm struggling a bit to grasp all DDD concepts and apply them to a real project. Let's say I have the following domain concepts: Car: a vehicle moving inside an area Path: a journey made by a car, ...
-3
votes
1answer
160 views

Is algorithm performance dependent on the programming language used? [closed]

I have studied complexity of algorithms that how long an algorithm will take to execute completely, then why it is said that certain programming languages are faster than others such as C++ is faster ...
2
votes
1answer
163 views

Would de-coupling using interfaces/templates make the system easier to maintain at the cost of over-engineering?

I have been practicing this hybrid approach for dependency injection in the last couple of days and I am wondering if it should also apply to components which are within the same package? For example:...
12
votes
3answers
2k views

Working through the single responsibility principle (SRP) in Python when calls are expensive

Some base points: Python method calls are "expensive" due to its interpreted nature. In theory, if your code is simple enough, breaking down Python code has negative impact besides readability and ...
1
vote
1answer
99 views

How to implement a partial resource rest api?

I first posted this question on stackoverflow but I think, it as more it's place here. In order to limit the size of my REST API answers, I want to implement the Google performance tip: using the ...
1
vote
2answers
220 views

How are “registers” implemented in VMs?

Process VMs (such as the Oracle JVM, CPython, .NET CLR etc.) are usually stack-based or register-based. Are the "registers" in a register-based VM actually the registers of the underlying physical ...
0
votes
0answers
55 views

Zipping and downloading multiple files

We're currently designing an web application that will basically expose "messages" to end users, each message consisting of a subject and body, but more important 1 to many files we call "attachments"....
0
votes
2answers
144 views

Does chaining higher order functions mean worse performance?

For clarification, let's review the following example: Consider that we have the following array of Ints: let array = [1, 2, 3, 4, 5] and we've been asked to generate a new array from array ...
2
votes
3answers
202 views

Comparison of build times on various hardware; why non-linear results?

Why do the compile times not vary significantly between different era CPUs, even though disk (NVMe vs. HDD) and CPU benchmarks vary significantly in performance? Why does disabling hyperthreading ...
1
vote
2answers
230 views

Splitting a critical application into multiple executables

We're developing some C++ application that analyses strings using some data. The data is large (a few gigabytes) and takes a significant amount of time to load into memory, and timing, as well as ...
1
vote
1answer
57 views

Efficient and readable method for styling of javascript webcomponents

I have a web page that loads a very long list of custom web components, each with their own shadow DOM and a stylesheet shared by all instances. Originally, I included the stylesheet as css file ...
1
vote
1answer
193 views

Best practice with SignalR communication

I'm working on a project that involves online purchases. I have my web api in C# and my client in REACT (javascript). Server and client are connected with SignalR. I want that when an ORDER is ...
0
votes
1answer
148 views

Efficiency in Java: Object reference vs id reference

I have to represent a certain data structure, in which I have nodes that are related between them. Each node has its numeric id, and a list containing the next directly related nodes and another list ...
2
votes
3answers
251 views

In c++, is there a way inside a function block, to execute cleanup code after the value has been returned?

Backstory (You can skip) I am building an API for managing Files and Directories in a consistent manner across a project. This is for deduplication and consistency when performing a task, and in this ...
2
votes
4answers
309 views

Using Instance or Static Method for reusable method

I have made a lot of forms for my desktop application, some forms were using the same method which I have to copy and paste the code (not OOP). Let's say I have a method called FirstDayOfWeek() and ...
2
votes
3answers
227 views

What's faster.. Multiple variables or single array? [duplicate]

I have a C-coded function that realizes a very long calculation on a microcontroller. I try to optimize it for speed at the moment. The function content is created automatically using Mathematica. It ...
0
votes
1answer
79 views

Storing session data on client or server side

I have an Android application that communicates with the server using REST. During the flow, the client(Android) usually send 3 separate requests to the server with different data. Some of the data ...
-2
votes
1answer
21 views

Filtering the Data and summing on one field Should I do in JAVA or write query with aggregate query with filter clause?

I have one table in which there would be millions of records. The requirement is to the records based on the condition and then total on one of the fields. Selectivity would be around approx 50. ...
0
votes
1answer
38 views

Design decision for a cross-platform text editor that optimized for speed

On designing a cross-platform text editor that optimized for speed - I heard atom.io uses node.js, would it be slow? I heard sublime text uses C++, would it lots of effort to be cross platform and ...
0
votes
3answers
106 views

Should I reuse a predicate for multiple IEnumerable checks

In a long running Windows Service I have a custom thread pool manager that has a loop which continuously looks through a couple lists for idle threads. Given multiple uses of the same predicate, is ...
-4
votes
2answers
164 views

Performance question - what are the defects of high level programming languages and compilers that makes assembly still a better choice today [closed]

What I want to know is, how can we still make use of assembly today, in productive manners? When assembly outperform C, so it would seem practical to write a section of the project in assembly rather ...
1
vote
0answers
53 views

User level customised activity feed design

I am working creating api for activity feed of user. Feed contains different type of entities. Before that let me give you bit overview about the app. Its a video app where Users can ask questions ...
1
vote
2answers
118 views

When using an ORM when should I sacrifice performance for convenience?

I work with SQL Alchemy a lot and, as a "lazy programmer", I enjoy the convenience it offers. But the "diligent programmer" in me often worries about optimisation and the performance of the queries ...
13
votes
7answers
755 views

Saving high-frequency events to a connection-limit constrained database

We've got a situation where I have to deal with a massive influx of events coming in to our server, at about 1000 events per second, on average (peak could be ~2000). The problem Our system is ...
106
votes
15answers
14k views

When to optimize for memory vs performance speed for a method?

I recently interviewed at Amazon. During a coding session, the interviewer asked why I declared a variable in a method. I explained my process and he challenged me to solve the same problem with fewer ...
0
votes
1answer
111 views

Security and performance considerations when creating chat system on a Flask backend

I am building a website with the Flask framework. One functionality of the site will be that users can send messages to each other. I created a prototype of this using Flask WTF forms. The basic ...
1
vote
2answers
228 views

How to benchmark software performance under same conditions (RAM, CPU caching etc)?

I am writing a software that splits big files into smaller files and I have coded several solutions. I am measuring the execution time of each of my solutions. (with threads, go routines, MPI etc) ...
1
vote
1answer
180 views

When is creating a supplier for an object less expensive than creating the object itself?

Objects contains 2 method overloads where one takes an object and the other takes a Supplier of that object: public static <T> T requireNonNull​(T obj, String message) public static <T> T ...
2
votes
1answer
88 views

If you can store BigInts in a more optimal way than an array

This suggests just storing BigInts as an array: // n = -123 var n = { sign: -1, digits: [3, 2, 1] }; However, if you have "big ints", that array will get large: var n = { sign: -1, ...
2
votes
0answers
70 views

Performance: Creating duplicate file

I have a Web server (Local) and File server(Remote). I need to create a duplicate of an xml file in the same location with different file name in the File server. The size of the file is random, but ...
0
votes
1answer
58 views

Better to store miscellaneous metadata in database or calculate on each access

I have a number of attributes I need for various page loads and other backend tasks, and I'm debating on whether storing these things in a database or calculating them on the fly. For instance, if ...
0
votes
1answer
77 views

Logic circuit simulation: homebrew or third party solution?

Software I'm working on requires simulation of logic circuits, both combination and sequential. Now the simulation doesn't need to be too detailed, in fact it could be detrimental to the function of ...
1
vote
3answers
58 views

Calculating Journey Summary made by a vehicle and Cache them to database

This is more of a point me in the right direction kind of question, I have 2 solutions but both of them are invalid because the data calculated is invalid in some scenarios. I am working on a system ...
0
votes
1answer
120 views

Simple but frequently throwing vs reasonable but rarely throwing vs complex but never throwing [duplicate]

A lot of code that's designed to convert or parse some data of type Foo into a Bar is written with the assumption that one wouldn't intentionally pass it invalid inputs. As such, it assumes that ...
7
votes
2answers
586 views

How did heavy software in the early days managed to run on 4MB RAM computer? [duplicate]

It's no secret that in the early days of computers, they had only 1-4MB of RAM. I found an article stating you needed only 4MB of RAM to run Word, Excel and PowerPoint simultaneously. How was that ...
4
votes
2answers
5k views

Why should I use foreign keys in database? [closed]

In my 10+ years of experience in the IT field, I have never used foreign keys in any of my project and I never felt the need. I did work with professional databases which had foreign keys constraints. ...
2
votes
2answers
719 views

How do I avoid increased memory consumption by browser and performance degradation when dealing with many records?

In my MVC 5 web application there are many instances in which users will require to view thousands of records within grids, now I managed to get around many performance related issues by utilising the ...
3
votes
4answers
373 views

High Performance Garbage Collection

I am new to garbage collection but have been looking around. I have noticed that Reference Counting has a very bad reputation (PHP, Python), as well as Conservative GC (Ruby) under certain conditions. ...
1
vote
1answer
331 views

Would Cython-like “Cypescript” be a feasible idea?

Cython is a superset of Python that can be complied into C modules that can be imported and used normally in Python code. This can be used to speed up parts of a Python program. In a recent project, I ...
-1
votes
1answer
31 views

Tolerated Performance when generating a document from SQL

Is it acceptable for a framework to generate an XLS document of more than 300k rows and 6 columns in 2 minutes? This framework took 2 minutes to generate the document while fetching data from a local ...