-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving performance #117
Conversation
f8876c2
to
b6af70c
Compare
src/include/encryption/enc_tuple.h
Outdated
extern void | ||
pg_tde_crypt_simple(const char* iv_prefix, uint32 start_offset, const char* data, uint32 data_len, char* out, RelKeysData* keys, const char* context); | ||
extern void | ||
pg_tde_crypt_complex(const char* iv_prefix, uint32 start_offset, const char* data, uint32 data_len, char* out, RelKeysData* keys, const char* context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor thing - should those be "external" (I mean to it looks like rather "private" functions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I considered simply calling the simple function at some places, but it is safer to always call the main function and it doesn't matter that much. I'll remove these from the header.
This commit tries to improve the performance of our encryption, based on the results reported in percona#89. It contains two main changes which results in improvents: * Our pg_tde_crypt loop has several conditions to support all possible cornercases it might encounter. These conditions are not neccessary most of the time, but slow down our throughput considerably. This commit introduces a "simple" version of the function for smaller data sizes, which only has a simple one instruction for loop. * OpenSSL supports in place encryption when certain conditions are met - which is true for our zeroblocks function. The zero block function no longer uses an additional local array, and the filling of the input data is also simplified. These changes together results in the following encryption overheads: * json testcase: 140% -> 120% * jsonb testcase: 230% -> 175% Closes percona#89
uint64 aes_block_no = start_offset % AES_BLOCK_SIZE; | ||
char ivp_debug[33]; | ||
iv_prefix_debug(iv_prefix, ivp_debug); | ||
ereport(LOG, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to log this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's inside an ENCRYPTION_DEBUG
macro
This commit tries to improve the performance of our encryption, based on the results reported in #89.
It contains two main changes which results in improvents:
These changes together results in the following encryption overheads:
Closes #89