Closed DK96-OS closed 2 years ago
ArrayDeque appears to be aggressively resizing before reaching capacity, reducing the performance of targetedIndex
at indices just before 24. To prevent this, a different Queue implementation can be used, or just a simple ByteArray that doesn't resize.
Graphs will be produced soon, showing what a difference these changes have made. The data is there in the GitHub Actions test artifact, for now.
Processing and formatting test result data in a CSV file friendly format is an essential feature in performance testing automation for achieving greater efficiency.
To reach a greater level of testing automation in this area, additional methods involved in data assessment are suggested:
The goal of this PR however, is to simply demonstrate that the implementation of a static byte array for the first n primes can improve performance, and to begin using it immediately in the main release.
The way that this will be demonstrated is intended to set a high expectation of quality for future development in this project. When future performance claims are made, they will be easily compared with this existing data. Thus, a sufficient investment in data processing and formatting is in preparation.
Looking forward to wrapping this one up using new statistics ( #24 , #27 ) and performance testing methods ( #22 ).
Implementing a static ByteArray inside
PrimeCacheBase
has demonstrated a significant performance improvement across all methods of interest (those measured byPrimeCachePerformanceTest
).The proposed changes are a great start to optimization. Further tests and comparisons are recommended before merging, as there is certainly more to gain through careful and patient study.