Top "Optimization" questions

Optimization is the act of improving a method or design.

Creating an index on a timestamp to optimize query

I have a query of the following form: SELECT * FROM MyTable WHERE Timestamp > [SomeTime] AND Timestamp < [SomeOtherTime] I …

mysql optimization indexing timestamp
Coalesce function for PHP?

Many programming languages have a coalesce function (returns the first non-NULL value, example). PHP, sadly in 2009, does not. What would …

php optimization null-coalescing-operator
Set every cell in matrix to 0 if that row or column contains a 0

Given a NxN matrix with 0s and 1s. Set every row that contains a 0 to all 0s and set every …

algorithm optimization puzzle
Generating permutations of a set (most efficiently)

I would like to generate all permutations of a set (a collection), like so: Collection: 1, 2, 3 Permutations: {1, 2, 3} {1, 3, 2} {2, 1, 3} {2, 3, 1} {3, 1, 2} {3, 2, 1} This isn't a question …

c# performance algorithm optimization permutation
Algorithm to get the excel-like column name of a number

I'm working on a script that generate some Excel documents and I need to convert a number into its column …

php algorithm optimization
Why does glibc's strlen need to be so complicated to run quickly?

I was looking through the strlen code here and I was wondering if the optimizations used in the code are …

c optimization glibc portability strlen
Django: Set foreign key using integer?

Is there a way to set foreign key relationship using the integer id of a model? This would be for …

django optimization django-models foreign-keys
while (1) Vs. for (;;) Is there a speed difference?

Long version... A co-worker asserted today after seeing my use of while (1) in a Perl script that for (;;) is faster. …

c++ perl optimization performance
How can I know which parts in the code are never used?

I have legacy C++ code that I'm supposed to remove unused code from. The problem is that the code base …

c++ optimization dead-code
LoggerFactory.getLogger(ClassName.class) vs LoggerFactory.getLogger(this.getClass().getName())

I'm trying to improve my optimization skills in Java. In order to achieve that, I've got an old program I …

java logging optimization reflection slf4j