multithreading - Multithread + C# + Performance + SQLite -


i have windows form application.
(c# visual studio 2010, framework : 4.0)

database: .db (file database), connection object through sqlite

thread th = new thread(() => database(node, xnodetcname, xnodesqlquery1, xnodehint, e, inxml)); th.name = thread; th.start(); 

above code create each thread , processing parallel on database() function.
each thread having 1 sql query fetching data database.

while not use multithreading performance better when use multithreading performance down.

example:

without multithreading 3 query processing time = 1.5 minutes
multithreading 3 query processing time = 1.9 minutes.

my aim reduce processing time of query.

then stay away threads.

some basic edutation: in cases database performance limited io, not cpu. io can partialyl mitigated using lot of memory buffers, hence large database servers have tons of memory.

you run small leightweight databasde. not running on database server level hardware or ssd - has io problem. perforamcne limited io.

now multiple threads make sure io side (hard disc) inefficieent, especialyl because winform app not running on high end io subsystem.

ergo: if want faster query then:

  • optimize query. missing index?
  • get proper hardware , / or upgrade heaver setup. ssd great here.

do not use multi threading - try solve on sql level accept may not possible. there reason companies still use real database servers handle large data amounts. , sqlite may not option - no chance saying or not totally ignore side in information.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -