-
Notifications
You must be signed in to change notification settings - Fork 380
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
WT-11634 Provide optimized versions of set_key/value for MongoDB index use cases #10549
Conversation
WT_SESSION_IMPL *session; | ||
|
||
CURSOR_API_CALL(cursor, session, ret, set_raw_key_value, NULL); | ||
WT_ERR(__cursor_copy_release(cursor)); |
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.
Did you consider refactoring and using set_raw_key
and set_raw_value
internally? I know we are chasing performance here, but the duplication of complex and subtle code worries me.
There also doesn't seem to be enough checking to make sure the API is used as expected. I'd expect that to be present in at least diagnostic builds, and preferably everywhere: This is a primary mechanism for applications to give context to WiredTiger, which it will operate on. Ensuring the data is in an expected state/format on entry is necessary to limit how much further checking/safety we need inside the library.
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.
Hi @agorrod , as I understand it, part of the challenge here is that __wt_cursor_set_raw_key
and __wt_cursor_set_raw_value
call set_key
and set_value
respectively, and those functions take va args parameters. Removing the va args usage (and perf cost) is a main benefit from this proposed change.
Obviously, if there are opportunities to refactor the code and/or take a simpler approach then we should do so.
@@ -0,0 +1,154 @@ | |||
/*- |
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.
Hi Ravi, do we need this new test file? I'd consider performing similar tests using the Catch2 framework instead, and adding them to those you have added in test_cursor_set_raw_key_value.cpp.
Test coverage is too low, this change probably shouldn't be merged as-is.
|
The changes include the following:.