Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Faster file stat #1183
While investigating performance regressions on
This commit adds a new
The difference is great:
The regression goes from 10% slower to 4% slower (without the fixes I made in the other PR). We still need to make 2 calls, because
The commit above adds a JMH benchmark of the various implementations we have so far.
There are 4 different implementations:
Here is the result on my laptop (Linux, ext4, SSD):
What we can see is that the NIO version is significantly faster, as long as the file exists. Its performance is catastrophic if the file doesn't exist. Which is exactly why the
For existing files, native platform and jdk7 have barely the same performance, while the fallback version is significantly slower.
In short, given those results, I think it makes sense to use jdk7 by default under Linux. It would be nice to run this benchmark under OS X and Windows to see the difference. Eventually, it would be nice to find out why the JDK can be significantly faster than
/cc @oehme for the record
So here's the result for Mac OS:
First we can see that it's almost twice as slow as under Linux, but
So here are the latest results, after rebasing on
There's barely a difference, but it does seem to confirm that
Here are results of the benchmarks executed on the CI server build agents.
Apart from the fact that Windows is considerably slower (is that a surprise?), it seems to confirm that we should use:
And it would be interesting to know why