Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Cancel
25
  • 13
    Good point! In our case we are dealing with approximately 1.5 million key/value pairs read from XML and CSV text files into 200k records. Small by comparison to databases that run sites like SO - but big enough that tuning SQLite performance becomes important. Commented Nov 10, 2009 at 22:34
  • 56
    "We have large amounts of configuration data stored in XML files that are parsed and loaded into an SQLite database for further processing when the application is initialized." why don't you keep everything in the sqlite database in the first place, instead of storing in XML and then loading everything at initialization time?
    – CAFxX
    Commented Feb 21, 2012 at 8:36
  • 15
    Have you tried not calling sqlite3_clear_bindings(stmt);? You set the bindings every time through which should be enough: Prior to calling sqlite3_step() for the first time or immediately after sqlite3_reset(), the application can invoke one of the sqlite3_bind() interfaces to attach values to the parameters. Each call to sqlite3_bind() overrides prior bindings on the same parameter (see: sqlite.org/cintro.html). There is nothing in the docs for that function saying you must call it.
    – ahcox
    Commented Aug 3, 2012 at 19:33
  • 27
    Did you do repeated measurements? The 4s "win" for avoiding 7 local pointers is strange, even assuming a confused optimizer.
    – peterchen
    Commented Nov 26, 2012 at 15:11
  • 12
    Don't use feof() to control the termination of your input loop. Use the result returned by fgets(). stackoverflow.com/a/15485689/827263 Commented Nov 3, 2015 at 22:38