Questions tagged [optimization]
Optimization is the process of improving an existing program to make it work more efficiently or/and using less resources. Remember this site is only for conceptual questions, so please ask only conceptual ones about optimization. If you want your specific code to get optimized, better ask the question on StackOverflow or CodeReview.SE.
407 questions
-1
votes
1
answer
8
views
In dynamic programming, do switch-case statements perform worse than function tables?
The reason I wanted to ask is because of some code from Undertale that is responsible for choosing which dialogue set to use. It works something like this:
switch (id) {
case 0:
msg[0] = &...
13
votes
5
answers
3k
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 ...
-4
votes
3
answers
256
views
Optimizing a "Transfer-Encoding: chunked" parser [closed]
I have written a parser for Transfer-Encoding: chunked requests over HTTP/1.1. Now I'm working on optimizing the code. This is the specification 7.1. Chunked Transfer Coding.
The first optimization ...
1
vote
1
answer
157
views
Optimal way to match prioritized list of tasks with available workers
Problem
Match prioritized tasks with suitable workers.
Details
Consider a task with following properties - type and size. Based on task type, tasks are prioritized.
While a worker has following ...
10
votes
7
answers
4k
views
Does memoization skew benchmarks?
I'm writing a program that works with directed acyclic graphs and performs rewriting operations on them. Sometimes the graphs are small, sometimes they can be very large and grow as the program ...
3
votes
3
answers
641
views
How can single thread execution speed further increase since frequency stagnates?
What are things that newer CPU can do to speed up single thread execution?
multiple registers? (can compilers always benefit from it?)
SIMD? (do compilers use SIMD without code annotation?)
does a ...
0
votes
0
answers
66
views
Production Line Optimization in MATLAB
I'm trying to model a metal treatment process to improve its efficiency. We have 11 different components that all have to flow through the same process, but each component spends a different amount of ...
0
votes
4
answers
209
views
Should a null block be used for semantic purposes?
I was writing a procedure that is only applicable in a particular case, but it didn't feel right to enforce it by contract or raising exceptions, because there's no problem with calling it in other ...
0
votes
0
answers
122
views
Is it possible to build a semantically unambigous grammar / language / graph?
It's been a long time that I had an idea of a semantic constraint as compiler optimizations which allows for sophisticated high level optimization allowing you to transform the AST/CFG based on a SFG (...
0
votes
3
answers
199
views
Optimize reservation system algorithm
Im am developing a logistics application and at the moment, I try to solve the following problem:
In the system, there are multiple machines.
Each machine has one or more skills. For example, machine ...
-2
votes
2
answers
303
views
How does Java and other managed languages achieve any performance, if everything is allocated at random places of the heap? [closed]
Prelude
Recently, I helped a friend of mine in coding him a problem for his university Algorithms course, where problems are submitted in Java. I sent him code with good O notation complexity, ...
0
votes
0
answers
52
views
Designing an optimization on throughput of EF.Core application
I am looking for feedback on a design problem I encountered when processing batches of db entries. The issue at hand is efficiency and throughput of an application.
The application looks like this ...
0
votes
1
answer
171
views
How can I minimize the number of captured variables in lambda expressions? [closed]
If a lambda is frequently used, it is considered to reuse the same instance instead of creating new instances repeatedly.
How can I minimize the number of captured variables in lambda expressions?
15
votes
4
answers
5k
views
Better solutions than joining table for Many to Many?
Lets say I have students and classes which are 2 entities. A student can take many classes and a class can have many students. This would be a many to many relationship.
To solve this with an RDBMS my ...
25
votes
10
answers
10k
views
Shouldn't deep copy be the default, not shallow copy?
If you have an OO language, where every object always has a copy method, shouldn't that be deep copy by default?
In most languages I know, such a copy method is shallow, since a shallow copy is more ...