----- Original Message -----
From: Donald Griggs
To: [email protected] ; General Discussion of SQLite Database
Sent: Thursday, June 06, 2013 3:13 PM
Subject: Re: [sqlite] Serialize an in-memory database
Hi Philip,
Maybe neither of these two thoughts are helpful, but fyi:
1. Licensing for existing memory vfs.
Regarding this memory vfs implementation referenced earlier:
http://article.gmane.org/gmane.comp.db.sqlite.general/46450
http://spserver.googlecode.com/files/spmemvfs-0.1.src.tar.gz
Would it not be worth an email to the author ( gmail user stephen.nil ) to
see if he might quickly release his code (already open source) to public
domain or another acceptable license?
2. Performance of existing solutions.
Regarding, "I would like to avoid saving the data out to a temporary disk
file... That seems wasteful to me"
I can certainly understand why you'd write that, but it's different from
saying, "I've tested that solution (or put numerical bounds on its maximum
likely performance) and found its performance to be unacceptable for my
intended use."
Of course, using sqlite at all for your purpose (mainly to avoid writing
custom sorts, as I understand) is wasteful in some sense of the word -- but I
suspect its nevertheless an entirely appropriate application.
One of Donald Knuth's famous quotes was, "Premature optimization is the root
of all evil (or at least most of it) in programming."
If there's a chance that's applicable here (maybe its not), then since the
code to backup to a temp file is already present, would it be worth a try?
Respectfully,
Donald G. (definitely NOT Donald K!)
Hi Donald,
You have several good points. Let's see if I can respond to them properly:
1. I can definitely drop a line to the author and ask about the licensing.
But one appealing part of the vfs idea is actually sitting down and learning
enough to implement it myself. If I write the code, I will also be able to
debug it much more easily and will learn something new to boot. I have no
urgent need for a solution to this problem, so while I certainly would use an
existing memory vfs if it was available in SqLite itself I would also enjoy the
challenge of writing my own.
2. Let me change the word wasteful to unnecessary. I certainly have no doubt
that writing the temporary file and reading it back in would still be
acceptable performance wise in my scenario, and I have no figures to prove
otherwise. But it seems unnecessary to do so if an alternative method exists.
Copying it from one memory location to another seems a lot more elegant if
nothing else.
Kind regards,
Philip Bennefall
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users