Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
The current implementation use setSafe methods to dynamically allocate memory if necessary. For fixed width vectors (which are frequently used in JDBC), however, we can allocate memory proactively, since the vector size is known as a configuration parameter. So for fixed width vectors, we can use set methods instead.
This change leads to two benefits:
1. When processing each value, we no longer have to check vector capacity and reallocate memroy if needed. This leads to better performance.
2. If we allow the memory to expand automatically (each time by 2x), the amount of memory usually ends up being more than necessary. By allocating memory by the configuration parameter, we allocate no more, or no less.
Benchmark results show notable performance improvements:
Before:
Benchmark Mode Cnt Score Error Units
JdbcAdapterBenchmarks.consumeBenchmark avgt 5 521.700 ± 4.837 us/op
After:
Benchmark Mode Cnt Score Error Units
JdbcAdapterBenchmarks.consumeBenchmark avgt 5 430.523 ± 9.932 us/op
Attachments
Issue Links
- links to