Questions tagged [performance]
Questions related to improving application performance, this can be range from selection software architecture to selection of algorithms.
846 questions
13
votes
5
answers
2k
views
How do I find what's causing a task to be slow, when CPU, memory, disk and network are not used at 100%?
I'm currently analyzing a process that is considered too slow.
In summary, it's a task that loads a lot of data from Microsoft SQL Server, performs some basic stuff on it, and creates a report. It ...
1
vote
1
answer
297
views
Best way to merge files in java [closed]
I have a task to merge set of files and each file contains words ( separated by new line ). Files contains words in sorted order. Once merged all the files, it needs to preserve the sorted order. ...
-1
votes
1
answer
150
views
Passing In-Memory Specification to Repository
I am working on my DDD know-what/how and have the following questions related to the Specification Pattern, the Repository Pattern, persistence agnosticism, and performance.
Consider, for the sake of ...
-1
votes
2
answers
463
views
Text files vs. MySQL Performance for Large Dataset
I am currently making a system for users to generate flashcards for Languages.
This involves adding information such as the definition, pronunciation, and example sentences for a word.
So far, I have ...
-1
votes
2
answers
147
views
How to handle complex logic, avoiding recalculation for performance reasons?
let's say we're building an Ecommerce Marketplace.
We have Sellers and each Seller has Products.
We want to display a list of available Products across all Sellers to Buyers.
But, we only need to ...
0
votes
5
answers
293
views
Load and process (compressed) data from filesystem in the blink of an eye
We have a huge amount of queries hitting our API that request a minor or major extract of some huge files lying around on our mounted hard drives. The data needs to be extracted from the files and ...
6
votes
2
answers
2k
views
How to get out of a memory usage problem of a .NET application?
As mentioned in some StackOverflow posts (like this one), I'm dealing with a difficult situation:
My company is developing some C# applications (being a client-server application). We have migrated ...
3
votes
2
answers
1k
views
Maintaining global states in a recursive function
I am writing a recursive function. Some of the parameter data is different for each recursive call but some of the data only need to have one copy existing at any one time during the recursive call. ...
15
votes
6
answers
6k
views
Why is it necessary to mark classes as not inherited from? Can't an optimizer automatically detect that virtual calls are unnecessary?
In C# and C++, an apparent trend is in place to reduce / avoid inheritance:
C#: "Sealing types can improve performance."
https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/...
0
votes
2
answers
345
views
Build an API for a graph app with + 30 millions data points
I am quite new to design software and especially graphs. So I am working on a full-stack app with a back-end built on FastAPI (python) et front-end on React.
I need to create 4 graphs on a single page ...
0
votes
3
answers
175
views
Should web applications have predictable worst-case resource usage?
Consider Mastodon as an example - basically open source Twitter. Tweets can be up to 500 characters long. Of course, since it's open source, you can modify it to allow longer tweets. Unmodified ...
2
votes
1
answer
2k
views
Saving and reading files in user specific application data in C or C++
Most useful or reasonably complex applications need to save data such as user settings or saved games or browser history. I have been working on applications and games in C or C++ but I am not sure ...
-1
votes
1
answer
180
views
Fast methods to consolidate 20 csv files into one xml file [closed]
We have 2 systems Legacy & New and I have to migrate the data from the legacy system to the new system.
The legacy system exports the data in .csv format while the new system accepts the data in ...
2
votes
0
answers
232
views
Speed up implementation of "log transform" on 2D image
I'm working on an implementation of the "log transform" operator on an image for C++, and we currently have it formulated as follows (python code). Note we use log10 instead of the natural ...
15
votes
6
answers
6k
views
Accessing enemies' locations quickly in a 2D game
I have a simple 2D game which has squares, player (teal) and enemies (red).
class Game {
List<List<Square>> map;
Player player;
List<Enemy> enemies; ...
My problem is that I ...
8
votes
5
answers
10k
views
Is code written inline faster than using function calls?
I wrote some script in Python that creates a giant 2D matrix (1000x1000 or bigger) and fills it with random numbers. And after that, it goes through every element of the matrix and changes the number ...
0
votes
3
answers
791
views
Why isn't a counter used to avoid nested for loops for index based operations?
Let's assume we have a method that we want to run as fast as possible and it needs to loop on a 2D array, naturally we would do a nested for loop as such:
int[][] arr = new int[3][3];
for(int ...
1
vote
3
answers
254
views
Does it always take the same amount of time to retrieve the same thing from collection?
for example:
const arr = [1,2,3,4];
const coordinate = [arr[0] + 2, arr[0] + 1];
here arr[0] is written out twice, when the code is executed would it literally go and find same value twice or would ...
1
vote
1
answer
115
views
Can we reliably use unaligned scalars on contemporary hardware?
Processors have come a long way in their handling of unaligned data - from crashing at the very notion of it, through suffering severe penalties, all the way to having almost no impact.
I suppose it ...
-1
votes
2
answers
282
views
Performance hit after non-functional refactoring
I was asked to refactor some C++ code recently for the purposes of increasing unit testing coverage. The problem was that the code was tightly coupled on one compilation unit, so we had the equivalent ...
-1
votes
2
answers
234
views
Difficulty understanding how denormalization results in more storage necessary
I am having difficulty understanding how denormalization results in more storage necessary.
For example, let's say that in a normalized relation, there's Table 1 and Table 2. In order to join Table 1 ...
2
votes
1
answer
451
views
Difference between `Class.X` and `Class.getX()`?
Might be a silly question or something I might have just messed up in my head but here we go...
I saw a code example of someone using getPos() in their own class to retrieve the current position of an ...
3
votes
1
answer
1k
views
How to store a huge volume of time-series datapoints in an efficient way?
We have an application producing 5k-10k datapoints per second. Each datapoint has more than one metric, alongside its time of creation.
We are looking for an efficient, scalable way to store this huge ...
-3
votes
1
answer
77
views
Server performance and CMS scalability [closed]
I have been given the job of a colleague who has resigned and I don't know where to start. I hope you can give me some hints:
It is about a CMS made from scratch (Javascript/jQuery/PHP/MySQL) which ...
0
votes
0
answers
338
views
Improving performance of 'Weighted/prioritized left shuffle algorithm'
I wrote a prioritized/weighted left shuffle algorithm (the code is copied from my open source C# project Fluent Random Picker).
What does that mean? You've got some values and each of them has a ...