Skip to content

Commit

Permalink
2x integer key decoding perf
Browse files Browse the repository at this point in the history
Summary:
In my testing this reduces the overhead of integer decoding by 2x. The idea of the fix is straight-forward:
* Don't call Field* to get information, instead cache as much information as possible in our Rdb_field_packing, similar to InnoDB's row_prebuilt_t. This has a few advantages:
  * Avoid expensive virtual function calls
  * More cache friendly
* Similarly, don't use field->move_field / move_field_offset  to move field to the target buffer and then back - just write to the buffer using pre-calculated field offset directly
* Use template integer unpacking function to enable compiler to unroll expensive loops into a constant number of mov instructions.

NOTE: FDO data needs to be updated for this diff in order to take full advantage of this change.

Reviewed By: hermanlee

Differential Revision: D24383422

fbshipit-source-id: e00ee825935
  • Loading branch information
yizhang82 authored and facebook-github-bot committed Dec 9, 2020
1 parent ccb50cf commit 9af9aa5
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 209 deletions.
2 changes: 1 addition & 1 deletion storage/rocksdb/rdb_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ int Rdb_converter::convert_record_from_storage_format(
return err;
}

if (!decode_value) {
if (!decode_value || get_decode_fields()->size() == 0) {
// We are done
return HA_EXIT_SUCCESS;
}
Expand Down
Loading

0 comments on commit 9af9aa5

Please sign in to comment.