Projects:New Discounts Engine/QA
![]() | Back to Projects:New Discounts Engine |
Contents |
Testing
The discounts testing infrastructure created as part of this project, has been heavily used implementing automatic test cases for the different discount rules.
All these tests have been gathered together into a unique test suite that will be executed in CI.
Performance
Execution and Concurrency
It has been measured the execution times and the concurrency of the new discounts engine using different number of threads and different kind of tickets. These measurements has been done using the Graal based discount executor, both directly and indirectly through the discounts web service. The results are summarized in the following sheet.
Note that slowness problems in the discounts calculation were detected using JDK8. As it is planned to raise the minimum Java version to 11 in next releases this is not a stopper for the project and thus it will be discouraged the usage of the discounts web service with JDK8.
Thread Profiling
Thread profiling was done in order to find possible lockings between threads. The profiling was done for the discount calculation with the web service using 4 threads. Each thread will perform 1000 calculations of the applicable discounts of a simple ticket. Apart of some minor contention in the GraalSDK internals (Truffle) no sever problems were found.
Heap and Non-Heap
The memory consumption has also been measured. Due to our previous experiences when measuring the performance of other Javascript engine (see here), it was important to check that no memory leaks were being created, specially in the non-heap.
After measuring the memory consumption with multiple discounts calculations we did not find any memory leak and the both the heap and non-heap (and the amount of loaded classes) remains stable over time. It also seems that most of the objects generated during the discount calculation are all collectable.