Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSV, SQLite & 'txt.files' = how do they compare per speed
#1
[THIS HAS BEEN COPIED FROM AN eMAIL AND INCLUDES Gintaras response (below)]

My ? = Technically speaking, how much faster is a CSV file than 'getFile or setFile'? Let's say I have 10 items I want to get/set into variables, such as: filename, filepath, fullFilePath, etc. Is there a significant speed difference?

Here's an example from one of my macros:

--it has 3-levels of "listBox's" (parent list box that calls a child and a child that calls a grandchild listbox)

--each list box has 8 items [1) being the call for a child/grandchild and 2) being 'stop the macro')]

--each item has 10 properties that I store in a database

This means that when I call up this 'listBox' that 180 variables are potentially treated. So, I can either have these all in 180 different 'txt' files and use 'setfile/getfile'; or have all of them in three CSV files or in a SQLite database. So, what is the most efficient time wise? (I know that SQLite opens up a who new dimension of possibilities on how I can treat the data.)

I suppose what I am really after is the consideration that I have of beginning to use an SQLite database for storing my macro oriented data.

Thank,

Kent

*************************
Gintaras' response:
*************************
To measure code speed:
PerfFirst
code
PerfNext
can be more code and PerfNext
PerfOut


The speed depends on how everything is used.
I would use CSV for simple text of less than 100-500 KB total. Else Sqlite.
At first Sqlite's speed may disappoint, but it can be optimized. For example, QM files are Sqlite-based. My main file is 12 MB and I rarely notice a lag.
#2
Gintaras, I have a follow up on SQLite & how QM treats it =

"Does QM see or treat SQLite databases as a 'flat' database? So, is there any benefit for creating a multi-table 'relational' database for use with QM?

Also, if you have any suggested reading beyond what is in QM help for 'how to implement' a database & use w. QM I would appreciate it.

THANK YOU AGAIN!

Kent
#3
QM sees and threats SQLite databases as they are, without limitations. It provides SQLite API declarations and 2 classes that wrap the API, to make it easier to use.
QM-specific reading - macro "Sqlite help" and the F1 Help of Sqlite functions.
SQLite reading - http://www.sqlite.org


Forum Jump:


Users browsing this thread: 1 Guest(s)