commit | 925fab6b15306d66b8271cc27dc51bda74fdb8d3 | [log] [tgz] |
---|---|---|
author | Paulo Pinheiro <paulovictor.pinheiro@gmail.com> | Mon Mar 30 20:46:42 2020 |
committer | GitHub <noreply@github.com> | Mon Mar 30 20:46:42 2020 |
tree | cb2bbd784f3250da6acdcf7faf9facdfac885c40 | |
parent | d9fecc3327686e548c22ba5f7de084ff87b69841 [diff] |
[Java][FlexBuffers] Optimize Map access (#5735) The original implementation of map access is very naive: - Encode String to UTF8 byte[] - Creates a new KeyVector - Performs a binary search to find the key - return value So every access to the Map there was useless allocations of Keys and KeyVector and complete encoding of the search key, which for most comparisons would be wasteful. This changes completely removes the use of KeyVector and compute the key positions on the spot. Besides that, it compares keys codepoint-by-codepoint, avoiding unnecessary allocations and reducing encoding for most cases. Some benchmarks result in a 2.75x speedup.
FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.
Go to our landing page to browse our documentation.
and more in progress...
flatbuffers
tag for any questions regarding FlatBuffers.To contribute to this project, see CONTRIBUTING.
Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.