Insert time increases as db grows.

#1

Hello,

I've just installed ObjectDB and done some tests. I'm inserting 22k of records like 10k iterations of 22 linked entites. I've got indexes on Long id on every entity and additionally one entity have index on String column. Entities are not enhanced and inserts are committed in a separate transactions. My hardware is Intel i7 2x3.3GHz with 8Gb RAM. At first results was really impressive: 8,5 seconds against 30 seconds with hibernate+mysql. Then I started the test again and got 9,5 seconds; then 11 seconds and so on. Should I change my config in some way to get more stable insertion time?

#2

With enhanced classes you may get much better performance.

Enhancement is very easy. For example, you can apply enhancement by:

> java -javaagent:c:\objectdb\bin\objectdb.jar MyApplication

If the classes are not enhanced, at least call the clear method of EntityManager after every commit, to avoid further performance loss over time.

ObjectDB Support
#3

Well, I'm using Spring Data JPA, so I'm not sure I can call clear on entity manager, anyway thanks for your help.

#4

So just enhance your classes, it should solve the problem.

ObjectDB Support
#5

I've tried adding enhancer in maven goal and got no effect. I've also tried to use enhancer manually on classes, but still getting the same results: insertion time grows as db grows.

#6

I've just set enhancer as javaagent and everything worked like a charm: the execution time of test now is around 2 seconds. Thanks for assistance.

Reply