Linked Questions
94 questions linked to/from Is micro-optimisation important when coding?
7
votes
5
answers
17k
views
Is it ineffecient to store data as json in plain text? [duplicate]
We needed a persistent storage for API keys and I came up with reading and writing json in plain text and the user thinks it works but is it very ineffecient compared to a relational dbms?
I just ...
6
votes
2
answers
14k
views
Do nested conditionals have a significant performance impact? [duplicate]
This is a question that lives in my mind from a long time.
Does the use of multiple nested conditional statements impact the performance of a taken code? So far I know that programmers have created a ...
1
vote
4
answers
556
views
Write then optimise or write optimised [duplicate]
Do you write your code then optimise it? Or do you write an optimised code from the beginning.
I always believe in writing optimised since I really dont like to rewrite code, But please share your ...
0
votes
2
answers
5k
views
Static vs non-static in embedded systems [duplicate]
I am writing a C++ applications in the embedded area. A lot of times I think about should I use static or non-static const variable in the functions/methods? Here are my thoughts:
Static constant ...
3
votes
3
answers
1k
views
Temporary Variables or Not: Choose CPU Time or RAM? [duplicate]
In a case where multiple variables are set equal to an operation using the result of an other operation, is it best to create a temporary variable for the result of the second operation (this would ...
2
votes
3
answers
4k
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
3
answers
3k
views
Querying data with SQL vs. C# [duplicate]
I'm trying to decide who is right in the following argument:
How to effectively process data in MSSQL? Which one is faster?
Opinion 1: Data requests (this is especially true for complex ones) should ...
0
votes
1
answer
276
views
Which is better in terms of performance (bool01==bool02) vs (bool01 && bool02) [duplicate]
Which of these two is the better way of doing the same thing -
public void someMethod(String s, boolean bool02){
boolean bool01 = s!=null;
if(bool01==bool02){
doSomething();
}
}
OR
public void ...
1
vote
4
answers
304
views
When is it justified to write implicit conditions? [duplicate]
As a rookie programmer, I've only recently been digging into benchmarking, and have been comparing various ways of accomplishing the same task in terms of speed.
Most of the time, the result is ...
-3
votes
2
answers
156
views
Default assignment before if-elseIf or within if-elseIf-else , What is better in terms of performace/optimzation? [duplicate]
I have a piece of code where I need to assign a value to a variable, but base on condition, it could take other values. It can be done in multiple ways, but need to know which would be preferred in ...
-1
votes
1
answer
94
views
In a language interpreted line by line - is optimizing similar lines of code within a module into functions better in terms of efficiency? [duplicate]
While writing python code (I write python-selenium for GUI automation), I am facing situations wheer I have to deal with 5 widgets that do the same thing, just there xpath is differs by one term.
# ...
-1
votes
1
answer
70
views
Method that takes array parameter [duplicate]
I want to implement two methods: AddPlayers and AddPlayer. Is it better when AddPlayers calls AddPlayer or AddPlayer calls AddPlayers with a single item array? Is there a significant difference in ...
1
vote
0
answers
43
views
is it better to have tracking fields that are maintained separately for arrays? [duplicate]
I wasn't sure exactly how to word this question, but basically, I have a struct stNeuralLayers (for a neural network I'm playing around with) with fields that are matrices (such as a double[,] ...
306
votes
17
answers
115k
views
Is premature optimization really the root of all evil?
A colleague of mine today committed a class called ThreadLocalFormat, which basically moved instances of Java Format classes into a thread local, since they are not thread safe and "relatively ...