Is it more CPU-efficient to read/write config file or read/write sqlite database?

Irmen de Jong irmen.NOSPAM at xs4all.nl
Sat Dec 14 16:40:34 CET 2013


On 14-12-2013 16:29, JL wrote:
> I have a number of python processes which communicate with each other through
> writing/reading config text files. The python ConfigParser is used. I am wondering if
> it is more CPU-efficient to switch to using sqlite database instead of using
> configuration files. If the software does plenty of reading/writing, is it more
> efficient to use config text files or sqlite database?
> 
> Thank you.
> 

I think you're asking the wrong question...
Both options will very likely be constrained by I/O instead of CPU (in other words: do
you know for certain that you have a CPU-bottleneck right now?)
But both of them aren't well suited for inter process communication. Especially the
"reading/writing config files" sounds particularly sketchy.

Take a look at the myriad of options for *proper* inter-process communication (if that
is what you're after). It also helps to describe your situation in more detail so we can
give better answers.

Cheers,
Irmen





More information about the Python-list mailing list