[fpc-pascal] FreePascal and MySQL

Marco van de Voort marcov at stack.nl
Sat May 2 13:42:23 CEST 2015

In our previous episode, Terry A. Haimann said:
> I was kind of unimpressed with the performance of TSqlQuery compared to
> c.  
> I wrote two programs that built the same identical table.  A random set
> of names with addresses.  I found the user time of the program written
> in c was 20% of that which was written in Free Pascal.

Do not measure user time, measure the time within the program. C and Pascal
have differing library architectures, so that might obscure results.

The TSqlQuery is also fully runtime, the returned dataset is a runtime
typed concept. Did you setup your C code equivalent, e.g. by prompting for the
sql text?

Otherwise you are benchmarking runtime vs compiletime performance. Trying to
use the mysql api directly with compiletime typed result set parsing might
be faster from Pascal too.

More information about the fpc-pascal mailing list