Pre-allocate memory for the dictionary based on the data size to avoid resizing and improve deserialization performance.
Related issues
Does this PR introduce any user-facing change?
[ ] Does this PR introduce any public API change?
[ ] Does this PR introduce any binary protocol compatibility change?
Benchmark
# python format
fury_large_dict: Mean +- std dev: [dict_base] 548 us +- 33 us -> [dict_resize] 531 us +- 33 us: 1.03x faster
# xlang format
fury_large_dict: Mean +- std dev: [dict_xlang_base] 550 us +- 39 us -> [dict_xlang_resize] 527 us +- 35 us: 1.05x faster
What does this PR do?
Pre-allocate memory for the dictionary based on the data size to avoid resizing and improve deserialization performance.
Related issues
Does this PR introduce any user-facing change?
Benchmark