Sqlite in Java. Performance.

Average (table)

You can see that 1000 records block is inserted into database (auto-commit mode is disabled) in 625-1032 ms (or 711 ms average). This way one record insertion takes 0.63-1.03 ms ( or 0.71 ms average).

The same amount of data but in auto-commit enabled mode requires 607797-632985 ms for the whole block. One record requires for about 614 ms to be inserted.

According to our stats table if auto-commit mode is disabled insertion is at least 200-250 times faster then in auto-commit enabled mode.

Finally let’s see average insertion time of one record ( in 25, 100 and 1000 records blocks correspondingly):

AverageBarSo when it’s possible I’ll recommend to use in-memory cache and perform actual insertion into sqlite database using big blocks of records in auto-commit mode disabled.

One Response to “Sqlite in Java. Performance.”

  1. hibernated Says:

    there are many java libraries for SQLite, so would you please tell us which one used for this test?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: