Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

table_name: use Arc<str> #774

wants to merge 1 commit into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jan 28, 2024

Description of Changes

Switches most cases where a table / reducer name is stored to an Arc<str> rather than String.

API and ABI breaking changes

None

Expected complexity level and risk

1

@@ -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>,
Copy link
Contributor Author

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.

@Centril Centril force-pushed the centril/table-name-arc branch from 2c47521 to 5de2971 Compare January 28, 2024 14:16
cloutiertyler
cloutiertyler previously approved these changes Jan 28, 2024
Copy link
Contributor

@cloutiertyler cloutiertyler left a 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.

@Centril Centril dismissed cloutiertyler’s stale review January 29, 2024 08:20

Ran the generic benchmark numbers; many benchmarks are a wash; some regressions, some improvements, but I'm not yet satisfied.

@Centril
Copy link
Contributor Author

Centril commented Jan 29, 2024

This isn't yet a clear win; so let's hold off on merging. We might want to consider one of:

@bfops bfops added the reassessing Taking a step back to reconsider the problem/scope label Feb 2, 2024
@mamcx
Copy link
Contributor

mamcx commented Feb 13, 2024

Also, I think instead is the whole schema that should be under Arc/Rc

@mamcx
Copy link
Contributor

mamcx commented Mar 14, 2024

Because now DbTable & MemTable both have pub head: Arc<Header> this PR can be closed, right?

@Centril Centril mentioned this pull request Apr 3, 2024
@CLAassistant
Copy link

CLAassistant commented May 3, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reassessing Taking a step back to reconsider the problem/scope
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants