Menu

Performance problems...

Help
2005-03-15
2013-06-03
  • Jesper Söderlund

    I wonder if I'm missing something, but I'm getting really terrible performance when I tried our JDBM. I did:

                JDBMRecordManager dbMgr = new JDBMRecordManager(dbFile);
               
                JDBMHashtable table = dbMgr.getHashtable("simple");

                String text = null;
                long recordId = -1;
                long start = System.currentTimeMillis();
                for(long i = start; i < start + numberOfRecords; i++) {
                    text = "This is record " + i;
                    table.put(new Long(i), text.getBytes());
                }

                long stop = System.currentTimeMillis();
                System.out.println("Time to insert:" + numberOfRecords + " took " + (stop - start ) + "ms");

    And writing to a local file and with 100 items it takes over 6seconds on a quite decent IBM ThinkPad. It would be much faster inserting into a regular JDCB database, and then what is the point in using this library?

    Therefore I think that I must be missing something.

     
    • Alex Boisvert

      Alex Boisvert - 2005-03-17

      The reason for your poor performance is that JDBM handles all your operations in individual transactions.  If you want to increase your throughput, you should either turn off transactions or do more within each transaction.

      (Transaction incur necessary latency in order to synchronize data to disk.)

      alex

       

Log in to post a comment.