-
Notifications
You must be signed in to change notification settings - Fork 514
table_name: use Arc<str> #774
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
base: master
Are you sure you want to change the base?
Conversation
@@ -30,7 +30,7 @@ pub struct TxRecord { | |||
/// The table that was modified. | |||
pub(crate) table_id: TableId, | |||
/// The table that was modified. | |||
pub(crate) table_name: String, | |||
pub(crate) table_name: Arc<str>, |
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.
This was the impetus for making that change. It seemed to me wasteful to clone the string when we very rarely need to change it. So we can just clone a reference count instead.
2c47521
to
5de2971
Compare
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.
This looks good to me in principle. We should just coordinate the merging.
Ran the generic
benchmark numbers; many benchmarks are a wash; some regressions, some improvements, but I'm not yet satisfied.
This isn't yet a clear win; so let's hold off on merging. We might want to consider one of: |
Also, I think instead is the whole |
Because now |
Description of Changes
Switches most cases where a table / reducer name is stored to an
Arc<str>
rather thanString
.API and ABI breaking changes
None
Expected complexity level and risk
1