| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Another PR on improving getter access
|
@bbakerman I think is worth to also benchmark on JDK 17. |
Sorry, something went wrong.
Fixed test where parameters are present
Benchmark fix up
|
JDK 17 Benchmark Mode Cnt Score Error Units GetterAccessBenchmark.measureDirectAccess thrpt 15 458411420.717 ± 34329506.990 ops/s 0% GetterAccessBenchmark.measureLambdaAccess thrpt 15 334158880.091 ± 10666070.698 ops/s 27% slower GetterAccessBenchmark.measureReflectionAccess thrpt 15 63181868.566 ± 3887367.970 ops/s 86% slower |
Sorry, something went wrong.
| } | ||
|
|
||
| private static class CachedFunction { | ||
| Function<Object, Object> getter; |
There was a problem hiding this comment.
I remember reading that declaring fields final might improve method reference performance so it might apply here. Although maybe it was just static final constants.
Sorry, something went wrong.
| Function<Object, Object> getterFunction = mkCallFunction(sourceClass, candidateMethod.getName(), candidateMethod.getReturnType()); | ||
| return Optional.of(getterFunction); | ||
| } catch (Throwable ignore) { | ||
| // if we can make a dynamic lambda here, then we give up and let the old property fetching code do its thing |
There was a problem hiding this comment.
| // if we can make a dynamic lambda here, then we give up and let the old property fetching code do its thing | |
| // if we can't make a dynamic lambda here, then we give up and let the old property fetching code do its thing |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Another PR on improving getter access. Thanks to @arlampin for the inspiration.
https://wttech.blog/blog/2020/method-handles-and-lambda-metafactory/
https://www.optaplanner.org/blog/2018/01/09/JavaReflectionButMuchFaster.html
Early benchmarks on direct access versus lambda access versus the reflection method access we have today
JDK 1.8.0_191, Java HotSpot(TM) 64-Bit Server VM, 25.191-b12 - Mac M1