Questions tagged [efficiency]
Use this tag in reference to comparing the efficiency of various systems or algorithms, or methods to measure efficiency. Big O notation is more related to complexity, but could affect efficiency.
                183 questions
            
            
            
                8
            
            votes
        
        
            
                9
            
            answers
        
        
            
                6k
            
            views
        
        
            
            
        Does it make sense to keep two different versions of code?
                    I am developing projects for my private use and have been wondering how I should design my projects. I always try to keep the code as efficient and concise as possible and as readable as possible. ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                479
            
            views
        
        
            
            
            
        Most efficient mapping of pixel to colors with colormaps
                    I'm working on a module that handles colormaps and I want to make the mapping of pixel to colors as efficient as possible. It is a performance critical section of our app. Our current solution works ...
                
            
       
        
            
                24
            
            votes
        
        
            
                6
            
            answers
        
        
            
                9k
            
            views
        
        
            
            
            
        Best practice for redundant conditions in if-elif-else statements
                    What is considered better practice?
Case 1:
if n == 0:
    doThis()
elif n < 0:
    doThat()
elif n > 0:
    doSomethingElse()
Case 2:
if n == 0:
    doThis()
elif n < 0:
    doThat()
else:
 ...
                
            
       
        
            
                0
            
            votes
        
        
            
                4
            
            answers
        
        
            
                384
            
            views
        
        
            
            
            
        Do blockchains provide any improvement over conventional systems/frameworks when decentralization is not required?
                    I generally understand the blockchain framework. I have spent much time learning about how it, potentially alone, is able to provide for a decentralized system. For TRUE/ABSOLUTE decentralization, it ...
                
            
       
        
            
                1
            
            vote
        
        
            
                0
            
            answers
        
        
            
                146
            
            views
        
        
            
        Is there an optimal strategy for placing rectangles inside a window without overlapping?
                    My specific problem is that I have a vertically scrollable window into which I need to place rectangular <div> elements that are locked horizontally and have different widths and heights. ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                298
            
            views
        
        
            
            
            
        How is it possible to have an efficient edit-compile-try cycle on large codebases?
                    Related (but different) question:
How do you dive into large code bases?
I have always worked on small projects where editing a piece of code is easy: you modify the code, you recompile and in a ...
                
            
       
        
            
                4
            
            votes
        
        
            
                7
            
            answers
        
        
            
                8k
            
            views
        
        
            
            
        Representing a large list of complex objects in JSON
                    I am currently developing an API that returns JSON structures. One of the domain objects returned is a time series, which is a potentially large list (many thousands of elements) of complex objects.
...
                
            
       
        
            
                -1
            
            votes
        
        
            
                1
            
            answer
        
        
            
                93
            
            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.
# ...
                
            
       
        
            
                0
            
            votes
        
        
            
                3
            
            answers
        
        
            
                5k
            
            views
        
        
            
            
        Is it any more efficient to reuse a variable than to create a new object?
                    In a project I am working on we load various entities from the database, do some work then attempt to save the resulting entities.
If saving the result is not successful, we return a Result object ...
                
            
       
        
            
                -1
            
            votes
        
        
            
                3
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
            
        Does wrapping functions/'things' in classes reduce efficiency?
                    I was reading some C++ object-oriented programming notes that mentioned that we should avoid wrapping functions in classes if it is not required, since wrapping 'things' in classes would reduce ...
                
            
       
        
            
                33
            
            votes
        
        
            
                4
            
            answers
        
        
            
                7k
            
            views
        
        
            
            
        I am spending more time installing software than coding. Why?
                    I am developing code mainly using Bash, C, Python and Fortran and recently also HTML/CSS+JavaScript. My OS is Ubuntu.
Maybe I am exaggerating, but I figured that I kind of spend more time getting ...
                
            
       
        
            
                9
            
            votes
        
        
            
                12
            
            answers
        
        
            
                5k
            
            views
        
        
            
            
            
        Why do or should programmers save data in text based formats like JSON or XML instead of binary?
                    I see a lot of reasons to use binary over text-based formats.
With binary, I find it a lot easier. I can use fread(data, sizeof(struct DataStruct), 1, fileptr) to read, or fwrite to write data. I ...
                
            
       
        
            
                2
            
            votes
        
        
            
                2
            
            answers
        
        
            
                135
            
            views
        
        
            
        How can I efficiently make changes to a large module without having to re-run every time?
                    When making changes to larger modules in Python, this is my current (inefficient) process:
Make needed change to code
Run program to test (using pdb - python3 -m pdb path/to/script.py
Program will ...
                
            
       
        
            
                3
            
            votes
        
        
            
                3
            
            answers
        
        
            
                236
            
            views
        
        
            
            
            
        In which order perform tasks from big backlog
                    I have a big backlog of tasks gathered during last years. And new tasks are added occasionally. All tasks have the same priority and tasks never expire over time.
I was thinking of the reasonable way ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                867
            
            views
        
        
            
            
        Write complex query OR write simpler queries and combine the results in Backend service?
                    Take the following statement for example: 
  'Get results for ALL Active students of a Course'.
Naturally, this query has 2 parts, 
Get all active students of the course.
Get results of those active ...
                
            
       
         
         
        