Nuno Lucas wrote:
On 7/22/06, Eduardo <[EMAIL PROTECTED]> wrote:
Sorry, but i must disagree. He uses VC6, a compiler from
pre-alot-of-processor-advances. So, the compiler can't, not only
compile for a more modern and different processor (different
pipeline, sse, new processor modes, etc..) but also use old libraries
that were made for older processors. For example, in Delphi 6 (if i
remember well) code written in pascal run faster than assembly
optimized libraries, but written for 386!!!. In powerpc area (what i
know), using altivec libraries, boost sort code up to x16,
memory2memory copy, assign, move, etc... up to x4 and so on, but if
you use a compiler from pre-altivec era or non altivec optimized
libraries (including libc), your code will be a lot slower.
While I agree with you on the general, I must note that would be for a
CPU-bound application. Most sqlite applications tend to be IO-bound
(unless you have enough memory and is all cached), so the differences
will not manifest so much.
As an aside, there are applications that have better performance with
-Os (optimized for size) than with any -O<insert your favorite number
here>, because can incur in dramatically less cache misses (which is
several times slower than a cache hit and can also imply scheduling
decisions against the process/thread).
Regards,
~Nuno Lucas
Nuno has a very valid point that we certainly observe. Programs which
run all the time, expecially interpreters like the Sqlite engine, run
very much better when they are small so that the regularly used
components fit in the processor cache. Having compact data structures
can be a big help in keeping the working set cached.