Questions tagged [optimization]
Optimization is the process of improving an existing program to make it work more efficiently or/and using less resources.
400
questions
0
votes
4
answers
185
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
73
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
116
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
268
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
42
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
140
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 ...
23
votes
10
answers
9k
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 ...
0
votes
1
answer
270
views
How do function inlining and Tail Call Optimization affect call stack?
I've just accidentally came across this answer about inlined functions and I'd like to know how this affects call stack. But I can't add comments because I don't have enough rep so I decided to ask ...
3
votes
1
answer
376
views
Simulated Annealing
In relation to another question I had, I have been researching Simulated Annealing.
The general example used with this algorithm is the traveling salesman example. I have been testing the code ...
2
votes
2
answers
233
views
Optimizing Flash Memory Writes in Embedded Systems with Unpredictable Power Loss
I'm working on an embedded C++ project that involves logging certain types of statistical data (like successful accesses, failed attempts, and other events) to the flash memory (just incrementing ...
0
votes
1
answer
136
views
Use PGO (profile guided optimization) to determine optimal value of variables in code
Reading this interesting paper it seems that a lot of performance loss is due to scheduling overhead in tight loops. To recap: There's a variable called "Chunksize" which determines how big ...
8
votes
3
answers
229
views
Choosing one of two memory blocks to deallocate: Does age affect fragmentation?
First question here, so preemptive apologies if I've committed some faux-pas. Additionally, I am aware that this question is about possibly the micro-est of micro-optimizations ever, and "micro-...
1
vote
2
answers
314
views
String representation in Python runtimes
Python is one of the few languages to support a string data type of code points (Unicode Scalar Values). I'm also wanting to creating a language that has this same characteristic, but I need to ...
5
votes
4
answers
2k
views
Is it better to iterate over data once and do multiple complex operations, or to iterate multiple times with simpler operations?
Here I'm working in Python, but it's more of a language agnostic question, unless specific language features makes it clear that an option is better than the other.
I get my raw data from a REST API, ...