-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Measuring performance of Hibernate OGM
PostPosted: Mon Feb 23, 2015 4:01 pm 
Newbie

Joined: Mon Feb 23, 2015 3:53 pm
Posts: 8
Hello there,

I'm kind of new to this ''performance testing''. However, I would like to measure the performance of Hibernate OGM (+MongoDB).
Is there a particular way that is recommended to measure this performance?

I thought of making use of System.currentTimeMillis() before and after using the persist() method.
I'm not quite sure whether that is a handy and fair way of measuring the performance, since it is now measuring the insertion inside MongoDB as well rather than purely Hibernate OGM. So I thought I would check the time in my MongoDB logs and subtract this amount by the System.currentTimeMillis() calculations made before and after the persist() method for instance.


Top
 Profile  
 
 Post subject: Re: Measuring performance of Hibernate OGM
PostPosted: Tue Feb 24, 2015 7:05 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

Check out this post on SO to learn more about writing micro benchmarks in Java in general: https://stackoverflow.com/questions/504103/how-do-i-write-a-correct-micro-benchmark-in-java.

Then I recommend to take a look at JMH: http://openjdk.java.net/projects/code-tools/jmh/) for writing benchmarks.

We also have a basic set of performance tests based on JMH which may serve as base of inspiration: https://github.com/hibernate/hibernate-ogm/tree/master/performance

Hth,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: Measuring performance of Hibernate OGM
PostPosted: Tue Feb 24, 2015 10:11 am 
Newbie

Joined: Mon Feb 23, 2015 3:53 pm
Posts: 8
Edit:

Nevermind it works! :D Thank you mate!!!!! Now I will try to understand how your tests are actually setup ;)

I had to change 4.1.2-SNAPSHOT to 4.1.1.Final

-----------------------

Don't read this ;)

Thank you for the reply! The tests you provided available on Github really look interesting!

I tried to import the entire project into eclipse. Then I tried to run the Hibernate-OGM-Performancetest (after changing the persistence.xml file to my settings) project by right clicking on the launcher and then ''Java Application''. I got the following error:
Quote:
ERROR: Unable to find the resource: /META-INF/BenchmarkList


This lead me to think that I did not generate any file by Maven. So I right clicked on the project and then clicked on Maven -> Run As -> Maven Generate-Sources.
The following error occured:
Quote:
Failed to execute goal on project hibernate-ogm-performancetest: Could not resolve dependencies for project org.hibernate.ogm:hibernate-ogm-performancetest:jar:4.1.2-SNAPSHOT: The following artifacts could not be resolved: org.hibernate.ogm:hibernate-ogm-core:jar:4.1.2-SNAPSHOT, org.hibernate.ogm:hibernate-ogm-mongodb:jar:4.1.2-SNAPSHOT: Could not find artifact org.hibernate.ogm:hibernate-ogm-core:jar:4.1.2-SNAPSHOT -> [Help 1]


Sorry for this ridiculous newbie question. I tried to also launch Maven Install on the hibernate-ogm-parent but got an error regarding a check-style.


Top
 Profile  
 
 Post subject: Re: Measuring performance of Hibernate OGM
PostPosted: Wed Feb 25, 2015 3:26 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

Best is to run the build once on the command line:

Code:
mvn clean install -s settings-example.xml


The readme.md in the root dir gives instructions on how to build the code base.

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: Measuring performance of Hibernate OGM
PostPosted: Wed Feb 25, 2015 3:53 am 
Newbie

Joined: Mon Feb 23, 2015 3:53 pm
Posts: 8
Thank you mate, it works :)
Thank you for providing some example performance tests as well!


Top
 Profile  
 
 Post subject: Re: Measuring performance of Hibernate OGM
PostPosted: Fri Feb 27, 2015 7:23 pm 
Newbie

Joined: Mon Feb 23, 2015 3:53 pm
Posts: 8
Hello Gunnar,

I'm very sorry for posting an off topic question. I hope you won't mind:

Based on your performance testing using JMH, I figured I want to measure the performance of MongoDB itself and compare this with another NoSQL database (without Hibernate OGM).

If I look at the following code for instance, I assume I will only need to insert the method at line 44/91/124 for instance in a benchmark instead of the entire thing to measure the performance of MongoDB, correct?

https://github.com/hibernate/hibernate-ogm/blob/master/performance/src/main/java/org/hibernate/ogm/perftest/mongodb/nativeapi/NativeApiInsertBenchmark.java


Top
 Profile  
 
 Post subject: Re: Measuring performance of Hibernate OGM
PostPosted: Mon Mar 02, 2015 5:40 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Benchmarks are complex but I think it's faire to keep the structure creation as part of the benchmark. This is part of the overall "persistence" cost.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Measuring performance of Hibernate OGM
PostPosted: Tue Mar 17, 2015 8:29 am 
Newbie

Joined: Mon Feb 23, 2015 3:53 pm
Posts: 8
emmanuel wrote:
Benchmarks are complex but I think it's faire to keep the structure creation as part of the benchmark. This is part of the overall "persistence" cost.


Sorry for the late reply. Thanks for your comment. Good point.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.