Commit 311519b
2x integer key decoding perf
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.
Reference Patch: facebook@9af9aa5
---
Porting Notes:
There are some additional changes required to account for covering TEXT/BLOB changes, especially for blob I need to be able to call into ha_rocksdb->get_blob_buffer. I've added a new struct Rdb_unpack_func_context to be able to pass any additional required arguments without having to update all the unpack functions. For now I'm only passing in the table that we can use to get the ha_rocksdb handler.
Reviewed By: Pushapgl
Differential Revision: D258006941 parent 99062b1 commit 311519b
File tree
5 files changed
+232
-294
lines changed- sql
- storage/rocksdb
5 files changed
+232
-294
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6951 | 6951 | | |
6952 | 6952 | | |
6953 | 6953 | | |
6954 | | - | |
6955 | | - | |
| 6954 | + | |
6956 | 6955 | | |
6957 | 6956 | | |
6958 | 6957 | | |
| |||
6971 | 6970 | | |
6972 | 6971 | | |
6973 | 6972 | | |
6974 | | - | |
| 6973 | + | |
6975 | 6974 | | |
6976 | 6975 | | |
6977 | 6976 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3708 | 3708 | | |
3709 | 3709 | | |
3710 | 3710 | | |
3711 | | - | |
| 3711 | + | |
3712 | 3712 | | |
3713 | 3713 | | |
3714 | 3714 | | |
| |||
3871 | 3871 | | |
3872 | 3872 | | |
3873 | 3873 | | |
| 3874 | + | |
| 3875 | + | |
3874 | 3876 | | |
3875 | 3877 | | |
3876 | 3878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
| |||
0 commit comments