I tested new Oracle Java edition for Berkeley DB and for my tests the word that best describes the product is FAIL. The conslussion more or less is that Oracle screwed Berkeley software. They have no HASH, only BTREES, many functionality of BerkeleyDB has been removed, etc… They say is BerkeleyDB with Java flavour, they have a weird sense of java humor then.
I was expecting factor of 5X as many blogs suggested that on real applications we have this improvement. And since BeerkeleyDB for me has a lot of memory use and processing as well I was expecting at least 2X factor. I got a 2X factor but on the contrary.
Results
I did test for creating a table of 1 million rows with 128MB memory Cache.
| Language | Time |
| Python | 12 sec |
| Java | 28 sec |
So the refactoring of OctopusDbm, if any, will go through C++ inside Linux. I downloaded the Linux Tools for Eclipse and will start playing with those when I have some time.
It seems that Python with C modules work great.
[Update Feb 22 2010]
The tests were performed 5 times and get the average, plus:
- BerkeleyDB.4.7
- bsddb3-4.7.2 (Python API)
- Linux SuSE 10.1 Pentium 4 Hyperthreads
- Kernel 2.6.16
- Sun Java 5
And here is the code used:
/** * Testing for BerkeleyDB */ package test; import java.io.File; import java.util.Date; import com.sleepycat.je.*; /** * @author Jorge Alegre * */ public class BerkeleyDB { private final static String HOME = "/index/test/"; private final static long CACHE_SIZE = 128000000; private final static Integer MAX = 50000; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub EnvironmentConfig envConfig = new EnvironmentConfig(); envConfig.setAllowCreate(true); envConfig.setCacheSize(CACHE_SIZE); Environment env = new Environment(new File(HOME), envConfig); System.out.println("Data: " + envConfig.getCachePercent() + " " + envConfig.getCacheSize()); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setAllowCreate(true); long t_1 = new Date().getTime(); System.out.println(t_1); Database db = env.openDatabase(null, "testing", dbConfig); DatabaseEntry key = new DatabaseEntry(); DatabaseEntry data = new DatabaseEntry(); String sData = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; data.setData(sData.getBytes()); for (Integer i= new Integer(0); i |
Tweet This Post
Plurk This Post
Digg This Post
Ping This Post
