Top "Optimization" questions

Optimization is the act of improving a method or design.

Should import statements always be at the top of a module?

PEP 08 states: Imports are always put at the top of the file, just after any module comments and docstrings, and …

python optimization coding-style
Java HashMap performance optimization / alternative

I want to create a large HashMap but the put() performance is not good enough. Any ideas? Other data structure …

java performance optimization map hashmap
Is optimisation level -O3 dangerous in g++?

I have heard from various sources (though mostly from a colleague of mine), that compiling with an optimisation level of …

c++ optimization g++ compiler-flags
Java Reflection Performance

Does creating an object using reflection rather than calling the class constructor result in any significant performance differences?

java performance optimization reflection
Java NIO FileChannel versus FileOutputstream performance / usefulness

I am trying to figure out if there is any difference in performance (or advantages) when we use nio FileChannel …

java optimization file nio operations
Advantage of switch over if-else statement

What's the best practice for using a switch statement vs using an if statement for 30 unsigned enumerations where about 10 have …

c++ if-statement optimization switch-statement
Is there a performance difference between i++ and ++i in C?

Is there a performance difference between i++ and ++i if the resulting value is not used?

c performance optimization post-increment pre-increment
What is more efficient? Using pow to square or just multiply it with itself?

What of these two methods is in C more efficient? And how about: pow(x,3) vs. x*x*x // etc?

c++ c optimization
R solve:system is exactly singular

I am solving simple optimization problem. The data set has 26 columns and over 3000 rows. The source code looks like Means &…

r optimization solver
How do I choose grid and block dimensions for CUDA kernels?

This is a question about how to determine the CUDA grid, block and thread sizes. This is an additional question …

performance optimization cuda gpu nvidia