dmitry-chirkov-dremio commented on PR #55608: URL: https://github.com/apache/arrow/pull/55608#issuecomment-6874776305
Benchmark of building the cache key. The key is built on every `Projector::Make`, on a cache hit and on a miss, so this cost is paid each time. Measured locally on an Apple M3 (macOS arm64), compiled with `-O2`. Each number is the median of repeated runs. The benchmark calls the key constructor only. It does not compile anything. | Expression | Old time | New time | Old key size | New key size | |---|---|---|---|---| | nested IF, 3 arms | 0.003 ms | 0.0009 ms | 238 B | 137 B | | nested IF, 20 arms | 0.021 ms | 0.0027 ms | 1.5 KB | 0.7 KB | | nested IF, 673 arms | 2.44 ms | 0.074 ms | 51.6 KB | 22.9 KB | | nested IF, 5000 arms | 71.5 ms | 0.54 ms | 393 KB | 170 KB | | flat OR, 100 KB | 0.71 ms | 0.11 ms | 141 KB | 121 KB | | flat OR, 1 MB | 7.2 ms | 1.2 ms | 1.43 MB | 1.23 MB | What this shows: - Building the key is faster in every case. The old `ToString()` is quadratic on a deep chain. - The key is smaller in every case, so the cache does not use more memory than before. In the flat OR the size is mostly the string literals, which are stored as they are. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
