Skip to content
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

Attribute buffer is no longer shared, removing one RefCell. #222

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

orium
Copy link
Member

@orium orium commented Aug 26, 2024

This makes the median benchmark 3.6% slower. I'm now not pre-allocating the vector for the attributes and the median benchmark is now only 3.1% slower.

self.current_tag_token = Some(StartTag {
name: Range::default(),
name_hash: LocalNameHash::new(),
ns: Namespace::default(),
attributes: Rc::clone(&self.attr_buffer),
attributes: Vec::with_capacity(DEFAULT_ATTR_BUFFER_CAPACITY),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just create the attributes here instead of reusing the buffer (which IIUC was an optimization).

@inikulin inikulin merged commit 384f617 into cloudflare:master Sep 16, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants