DK96-OS / MathTools

Mathematical Software Components. This library is actively maintained, and aims to stay updated. New feature proposals are welcome, but may not be included.
Apache License 2.0
2 stars 1 forks source link

BytePrimeCache Static Array Optimization #23

Closed DK96-OS closed 2 years ago

DK96-OS commented 3 years ago

Implementing a static ByteArray inside PrimeCacheBase has demonstrated a significant performance improvement across all methods of interest (those measured by PrimeCachePerformanceTest).

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.

DK96-OS commented 3 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.

DK96-OS commented 3 years ago

Processing and formatting test result data in a CSV file friendly format is an essential feature in performance testing automation for achieving greater efficiency.

DK96-OS commented 3 years ago

Data Processing and Formatting

To reach a greater level of testing automation in this area, additional methods involved in data assessment are suggested:

DK96-OS commented 3 years ago

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.

DK96-OS commented 3 years ago

Looking forward to wrapping this one up using new statistics ( #24 , #27 ) and performance testing methods ( #22 ).