Comments (4)
Thanks for the tip. System.currentTimeMillis() is indeed bad, and nanoTime() is not monotonical and it has a varying precision between 10-1000 nanoseconds. For low latency benchmarks, nanoTime() is not very helpful, especially if the error keeps on accumulating (like measuring inside a loop).
I've been also using Codahale/Dropwizard metrics and they have two types of Clocks:
- the default one is based on System.nanoTime()
- the second one uses the CPU-time
ManagementFactory.getThreadMXBean().getCurrentThreadCpuTime().
But when it comes to a RDBMS, we are often talking about millisecond precision. Most test results are in milliseconds and even if we assume that nanoTime has a one microsecond precision, it shouldn't affect the test results as I need to round the results anyway. In one test, I think I showed the results rounded to 10 microseconds though.
from high-performance-java-persistence.
-
The thing is JMH forces you into well-structured, understandable benchmarks.
That is a big plus since that enables review of the benchmarks by experienced engineers. -
Even in JDBC world there are nano-second scale measurements.
For instance,.prepareStatement(String) & close()
is in that range. -
"average" is not sufficient. You need to show standard deviation, test under multiple threads, etc, etc.
from high-performance-java-persistence.
The JMH uses GPLv2. Aren't the stubs it generates also licensed as GPLv2? If that's the case, it won't be compatible with Apache 2.0 license of this particular repository.
from high-performance-java-persistence.
The idea is good but the real scope of these benchmarks is to prove we have an improvement, not to provide absolute or relative gains which will still be environment depending.
from high-performance-java-persistence.
Related Issues (20)
- The ebook from leanpub.com is impossible to buy from Russia HOT 5
- Issue with serialization HOT 1
- Need Instruction of Maven Configurations for downloading Oracle JDBC driver HOT 1
- URL link is broken inside Readme.md -MySQL section "here" link in sentense "Exact instructions can be found in here." HOT 5
- MariaDB Sequence Identifier Test-GlobalIdentifierGeneratorScopeTest.java HOT 1
- Oracle schema or MSSQL Schema? HOT 4
- CriteriaBulkUpdateDeleteTest.java is referencing a unimplmented method of CriteriaBuilder HOT 1
- The UnidirectionalOrderedOneToManyTest failed for "delete 1st entry" case HOT 1
- Compile not working / Oracle JAR requires authorization HOT 11
- What is the difference between JSP and servlet?
- Source code does not match book HOT 3
- Support for Hibernate Search HOT 1
- Unidirectional OneToOne has @GeneratedValue inside the Post_Details. HOT 1
- Book typo HOT 1
- Problem with CompositeId and Bidirectional @OneToMany HOT 1
- Set source code encoding to UTF-8 HOT 4
- methods ambiguous issues on ide HOT 2
- Set default JVM language as English for maven on non-english operating systems. HOT 2
- Cannot successfully testCompile, are some classes inside JOOQ missing ? HOT 2
- Activate the jOOQ module based on an Environment Variable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from high-performance-java-persistence.