Subject | Performance penalty if using threads? |
---|---|
Author | maverickthunder |
Post date | 2008-11-10T01:33:23Z |
Hi,
My home computer is a Pentium 4 @ 1800mhz with 1.5gb ram. I made an
app that run a background thread that download data from the web and
stores them in a firebird 2.1.1 db. The main thread is almost idle
because it only processed gui events.
I noticed that if I move the process to the main thread, the queries
(insert, update and select) are faster.
Also, I downloaded Firebird Maestro to try it and it has an option to
run queries in a separate thread. If that option is enabled, queries
takes too much time. E.g. deleting all records from a table (about
5,000) using DELETE without a where clause, in main thread version it
lasts 5 seconds... in the separate thread version, it took 20
minutes!!
So I wish to know if there are performance penalties if I run queries
in another thread instead of running them in the thread that makes
the initial db connection.
Best regards,
Mauro H. Leggieri
My home computer is a Pentium 4 @ 1800mhz with 1.5gb ram. I made an
app that run a background thread that download data from the web and
stores them in a firebird 2.1.1 db. The main thread is almost idle
because it only processed gui events.
I noticed that if I move the process to the main thread, the queries
(insert, update and select) are faster.
Also, I downloaded Firebird Maestro to try it and it has an option to
run queries in a separate thread. If that option is enabled, queries
takes too much time. E.g. deleting all records from a table (about
5,000) using DELETE without a where clause, in main thread version it
lasts 5 seconds... in the separate thread version, it took 20
minutes!!
So I wish to know if there are performance penalties if I run queries
in another thread instead of running them in the thread that makes
the initial db connection.
Best regards,
Mauro H. Leggieri