Linked Questions

4
votes
5answers
7k 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 ...
1
vote
4answers
335 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 ...
3
votes
2answers
3k 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
votes
2answers
2k 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 ...
0
votes
3answers
1k 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 ...
-5
votes
1answer
5k views

Using forEach on empty array [duplicate]

I have a dynamic array that can often be empty, and I need to iterate over all its elements. So far I have such code: array.forEach(function(item, index) { //stuff here }); It works fine of ...
2
votes
3answers
588 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 ...
0
votes
1answer
230 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 ...
1
vote
4answers
236 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 ...
2
votes
3answers
224 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 ...
-1
votes
1answer
55 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
0answers
32 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[,] ...
203
votes
17answers
57k 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 ...
97
votes
14answers
21k views

Is it bad practice to write code that relies on compiler optimizations?

I've been learning some C++, and often have to return large objects from functions that are created within the function. I know there's the pass by reference, return a pointer, and return a ...
75
votes
13answers
4k views

When is optimization not premature and therefore not evil?

"Premature optimization is root of all evil" is something almost all of us have heard/read. What I am curious what kind of optimization not premature, i.e. at every stage of software development (high ...

15 30 50 per page