UnQLite Users Forum

Commit As Less As Possible

append delete JediMaster

Hi !

I'm trying to make a unqlite backend for libgit2 to replace the native file system. But I found sometimes if I don't use unqlite_begin/unqlite_commit, the generated database file would be corrupt. But once I strictly use the transaction APIs, it also becomes extremely slow, slower than native file system, 5 times. Is there any good solution for this situation ? Thanks a lot !

Reply RSS

Replies

append delete #1. chm

A quick fix here is to keep a counter and commit to disk after 100000 inserts or so. With that you keep the ratio of database storage/disk transfer relatively low and you have descent stable performance report.

You can share your benchmarks here if you wishes.

Hope this helps!

append delete #2. JediMaster

Hi ! I will have a try then make the new benchmark, thanks for your help !

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: chm_at_symisc, devel_at_symisc