-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copying variable cells is particularly expensive because it has to construct and destruct the following two variables: ``` std::vector<std::vector<uint64_t>> offset_offsets_per_cs; std::vector<std::vector<uint64_t>> var_offsets_per_cs; ``` Most of the expensive is spent constructing and deconstructing the `vector<uint64_t>` elements. This patch caches both of these variables for re-use between calls to `copy_var_cells` within a single read. This works out well because the top-level array is the same size between attributes (the number of result cell slabs). In the multi-fragment read scenario that I'm currently testing, this provides a significant reduction in execution time: ``` // Without the patch Time to copy var-sized attribute values: 2.97894 secs ``` ``` // With the patch Time to copy var-sized attribute values: 0.988014 secs ``` While this provides a `2s` speedup in this path, I only observe a `1s` speedup in total read time. This is because the destruction of the above two variables is still expensive: it's just been moved into the `copy_attribute_values` path: ``` // Without the patch Time to copy result attribute values: 4.8275 secs ``` ``` // With the patch Time to copy result attribute values: 3.80167 secs ``` There will be a follow-up patch to optimize for minimizing destruction time. Co-authored-by: Joe Maley <[email protected]>
- Loading branch information
joe maley
and
Joe Maley
authored
Jun 20, 2020
1 parent
c69e3a9
commit fd46117
Showing
2 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters