Monday, November 17, 2008

Comparison between SQLite and H2 Databases

I found some article that says SQLite JDBC is slower than other DBMS. According to this source, SQLite took more than 11s for 100 insertions. This result is quite strange for me, and I guess no tuning option for SQLite is used in that experiment.

So, I wrote a simple test code to confirm the performance between SQLite and H2 databases. To the best of my knowledge, H2 is the fastest DBMS in the ones purely written in Java. Here is my test code.  In short, this code is optimized for insertions; using no transactions (a set of insertions is wrapped in a single transaction) and no locks. 

Tuning options for disabling lock acquisition:
SQLiteJDBC: pragma synchronous=off

For 1,000,000 insertions of simple records, I got the following results:
SQLite JDBC: 198.7 sec.
H2:    365.6 sec. 

If the above tuning options are not set in SQLite, each insertion acquires a file lock on the database file and creates an journal (log) file, so the performance will be significantly slower than the above result.

Although I can confirm SQLite is not slow, I have to admit SQLite JDBC driver has some overhead due to the interaction between native C codes and Java through JNI. When I used the command-line client of SQLite, it only took almost 100 sec for the same number of insertions through the import command of SQLite.

Ah, well, ... it's the nature of Java, which cannot beat sophisticated C programs in terms of performance.


invincible01 said...

Amazing Article

internship in chennai
internship in chennai for cse
internship for mba in chennai
internship in chennai for hr
internship in chennai for mba
companies for internship in chennai
internship in chennai for ece
paid internship in chennai
internship in chennai for biotechnology
internship in chennai for students

Kaylee Brown said...

I wonder how you became so capable to write such interesting and informative articles, any way you are one of the best bloggers in my eyes, Keep it up. computer network assignment help

Thomas More said...

Hmm, my younger brother is a computer science student. I think he will find this post helpful. I am sharing the link with him and then I have to look for dissertation presentation writing services for my marketing dissertation presentation. Ah, I wish I had taken computer science as well. This post looks interesting but sadly, I can’t understand it.

Dim4ksan said...

I spent a long time looking for a woman who would be supportive and helpful to me. But, sadly, I could not locate such a girl in my nation. It was a period when I truly needed a woman's help. Then I came upon an article regarding ukrainian women for marriage. I was interested in the prospect, so I started looking online. I didn't get very far, but with these guys, you may find a woman who will love and support you. I wish to suggest these gentlemen to everyone; they will not disappoint you and may perhaps alter your life.

tomassamanter said...

Posting a essay writer org reviews as a college application might be exciting, but it also needs a great deal of effort, focus, and study. This type of essay writing requires a lot of attention and time. A well-written college essay may leave a lasting impression on the admissions staff of the university to which you wish to apply.

Tom said...

This is soo cool! So dont be shy adn check thsi cool serivec for essyand hoewrmj and be rady for wins! Enjoy your day and be raedy for the english essay writer and have fun! Enjoy your day!

Masonethan said...

Hi everyone ! One of the most popular international student destinations is the United States. International students come to the United States to pursue their academic and professional goals. As a result, we continue to offer students in the United States the most legitimate and trustworthy coursework helper at affordable prices. We will continue to flourish on the confidence we have earned as long as we give security and privacy to our clients. They come to us if they are having difficulty paying their bills or if they require assistance with their chores.

Roman Davis said...

These two types of tests so that we may be able to check the students' ability. I like this way of testing because we can easily read about mental health, and then the teachers will teach them according to their cognitive ability. dissertation writing service

Michael said...

You can customize your photos in #yearinreview2016 and choosing your friends by scrolling down. Assignment writing service UK.

dry bulk trucking said...

Are you looking for an affordable and reliable CEMENT TREATED BASE service? Hasten Contracting can provide you with all the services you need to get your home or commercial property ready for Earthquake proofing. We use theCEMENT TREATED BASE service in texas latest technology and equipment to treat your base and ensure that it is compliant with all current codes and standards. Contact us today to learn more about our services, or book an appointment to see how we can help you!

Unknown said...

The Car paint protection shields against the effects of the suns UV rays; acid rain, sea and road salt and provide a high glossCar Paint Protection Dubai finish which retains its appearance wash after wash. With regular Conserver maintenance you may never need to polish your car again for the duration of the guarantee. Car Paint Protection Dubai

Mobile Car Wash Ottawa said...

Looking to get your car detailing done but don't know where to turn? Look no further than envirosteam! We are Ottawa's top car detailing company and we are here to take care of all your detailing needs. From car washesCar Detailing Ottawa to full car detailing, we have you covered. We also offer a free consultation to help you find the perfect solution for your specific needs. Contact us today and let us take care of everything!

jeeniehogwartz said...

Welcome to the one and only truffleers! We are a chocolate lover's paradise, where you can indulge in the finest chocolates from all over the world. Our selection includes truffles from some of the most famous and iconic chocolate manufacturers, such as Godiva, Lindt, Ferrero and more. We also have a wide range of seasonalBuy chocolate truffles Dammam flavors that are perfect for every occasion. Whether you're in the mood for a classic truffle or something new and exciting, we have you covered. So why wait? Come and explore our heavenly collection today!

Michael Alex said...

Because SQLite (by default) waits until the data is safely recorded on the disc surface before completing a transaction, transaction speed is restricted by disc drive speed. Philosophy Essay Writing Help.

lena kim said...

If you're in need of professional Edmonton foundation repair , look no further than Rammafoundation. We offer the best in quality and service to make sure that your foundation is in the best possible condition for your daily life. With our team of experienced professionals, we'll take care of everything from removal and replacement to color correction and fine-tuning. Trust us to take care of your foundation - it's what we do best!

Rubina Sudais said...

Hasten Chemical is a team of professionals who work to maximize the bottom line results of its clients. As a wholesaler of chemical products, Hasten provides unconditional commitment to excellence in quality, that will provide consistent results, and make us the partner of choice to help produce and maintain growth of Products and Service Companies.
Fly Ash Jacksonville

Nikkiasbela said...

Our capabilities stretch not only for new projects but also in the retrofitting of existing structures and equipping them to operate state of the art early detection & warning systems in order to safeguard critical assets in the long term.
Gas Leak Indicator

Writer said...

Thanks for your article! My friend recommended using one website to get writing tips on how to write reflective essay outline perfectly and I decided to visit this. I didn't regret it as I got very quality writing support with my paper.

Thomas Murphy said...

Can Someone Take My Online Class? Take Your Class Online offers best online class help! Just say take my online class for me. We offer do my online class help!

Writer said...

Well-written article! Get unique quality writing support from our american essay writing service in a very short time. Make sure it will be the right choice by reading a feedback page.


smart game booster crack
classroom spy professional crack
anycam crack
air explorer pro crack
automatic mouse and keyboard crack
swifdoo pdf crack

Jackob Wilson said...

If you wish to earn profits by staking crypto through Atomic wallet, then you can follow these steps for staking on Atomic wallet.
Atomic Wallet

jeeniehogwartz said...

Looking for a delectable chocolate treat that will tantalize your taste buds? Look no further than our truffleers! Our truffleers handcraft some of the most tantalizing chocolates in Jeddah, from dark and indulgent truffles to Buy chocolate gift Riyadhdelicate white chocolate ones. Whether you're in the mood for a sweet snack or a special treat, our truffles are sure to please. Come and sample our delicious chocolates today!