The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
ActiveRecordJDBC Database Speed Comparison

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Matt Williams

Posts: 24
Nickname: ottercat
Registered: May, 2007

Matt Williams is a subversive secretly replacing their java with ruby. Let's see if they notice.
ActiveRecordJDBC Database Speed Comparison Posted: Jun 1, 2007 9:46 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Matt Williams.
Original Post: ActiveRecordJDBC Database Speed Comparison
Feed Title: Subverting the Paradigm
Feed URL: http://subvertingtheparadigm.ottercat.net/feed/rss.xml
Feed Description: Which Paradigm? Pretty much all of them. It's about programming, exploring, management theory, development, and other radical notions. One day I'll talk about Ruby. The next day Rails. Javascript will be thrown in for good measure. Maybe even (gasp!) some Java. Thoughts about management style, too. A little bit of this, a little bit of that, all thrown together in a subversive attempt to change the world, but in a good way.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Matt Williams
Latest Posts From Subverting the Paradigm

Advertisement
So... You're wanting to connect to databases with JRuby and Rails. Which one is the fastest? Here's a comparison between Mysql, hsqldb, and Derby.

All the tests were run on an Acer Aspire 5112, AMD Turion X2 TL-50 (1.6Ghz), Dual Core 64 bit processor running Ubuntu Feisty Fawn in 32 bit mode, with 2GB of ram. Other apps were running, but they were consistant across the board.

The test was to run a series of 17 migrations where tables were created, populated, and columns added. No columns were modified or removed from tables due to limitations of driver support.

Comparison

Database Wall Clock User Sys Create Tables Preload Tables
mysql with MRI0m4.000s0m3.160s0m0.588s0m0.1663s0m0.3670s
mysql with JRuby0m29.202s0m46.383s0m1.352s0m0.278s0m1.1740s
Derby (networked)0m33.320s0m48.787s0m1.560s0m1.152s0m2.7500s
hsqldb (networked with default storage)0m32.830s0m46.659s0m1.416s0m0.277s0m1.5160s
hsqldb (embedded with default storage (memory))0m30.261s0m47.619s0m1.360s0m0.196s0m1.4020s
hsqldb (embedded with cached storage for all tables)0m32.866s0m51.423s0m1.804s0m0.306s0m1.3890s

Conclusions

Well, it's pretty clear that MRI blows them all out of the water due to the cost of starting the jvm. However, beyond that, you can see the hsqldb performs roughly the same as mysql -- a little slower perhaps in general, but in one case faster. Derby, however, is quite a bit slower.

I'll definitely be switching from Derby to hsqldb in my current application, and embedding the database. I'll use a mixture of cached and memory resident tables. Cached tables will be for data I definitely don't want to lose and which will change regularly, and memory resident for data which is preloaded and/or static.

Next comes the mongrel cluster in the jvm instance..... and a monitoring thread and the load balancer. Pack it in!

Read: ActiveRecordJDBC Database Speed Comparison

Topic: A couple of webcasts on DB2 Express-C Previous Topic   Next Topic Topic: image_science version 1.1.3 has been released!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use