Re: [Tinycc-devel] i just can't get over how farging fast tcc is...
From:
Stephan Beal
Subject:
Re: [Tinycc-devel] i just can't get over how farging fast tcc is...
Date:
Wed, 2 Feb 2011 09:18:32 +0100
On Wed, Feb 2, 2011 at 4:20 AM, Stephan Beal <address@hidden> wrote:
On Wed, Feb 2, 2011 at 4:09 AM, Gary Birkett <address@hidden> wrote:
Why not test it? :)
Okay, since i was provoked ;)...
Here's a test which connects to a mysql db, creates a small table, puts a few records in it, and performs some sanity checks on the DB API (the code i'm developing - a db access abstraction layer)...
~> time tcc -run -Iinclude -I. -rdynamic -L/usr/lib/mysql -lmysqlclient -lsqlite3 -L$HOME/lib tcc-test.c -m Testing against DSN [mysql5:dbname=cpdo;host=localhost;port=3306;autocommit=true;fieldbuffersize=128;enablenamedparams=true;ignored=hi]...
... big snip ...
real 0m0.080s user 0m0.020s sys 0m0.010s
With gcc:
real 0m0.070s user 0m0.000s sys 0m0.000s
only 1/10th of a second slower.
Interestingly... the same test against an sqlite3 database (exact same SQL operations, different back-end):
~> time tcc -run -Iinclude -I. -rdynamic -L/usr/lib/mysql -lmysqlclient -lsqlite3 -L$HOME/lib tcc-test.c -s Testing against DSN [sqlite3:my.sq3]... <snip>
real 0m0.240s user 0m0.030s
sys 0m0.000s
gcc:
real 0m0.199s user 0m0.000s sys 0m0.000s
gcc is still only about 1/5th faster. (What i cannot explain, though, is HTF MySQL is faster (and so much faster!) than sqlite? The MySQL server and the sqlite3 db are on the same hard drive, so drive/system speed differences aren't a factor.)