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

Simplify NodeSet#to_a with a minor speed-up. #1397

Merged
merged 1 commit into from
Jan 6, 2016

Conversation

larskanis
Copy link
Member

This stood up while reviewing #1362 (comment) . The speed-up is around 10%:

xml = Nokogiri::XML.parse("<r>#{"<a/>"*100}</r>")
set = xml.xpath('//a')
st = Time.now; 1000000.times{ set.to_a }; Time.now - st

... changed from 8.2 to 7.3 seconds on my (slow) netbook.

larskanis added a commit that referenced this pull request Jan 6, 2016
Simplify NodeSet#to_a with a minor speed-up.
@larskanis larskanis merged commit 0733136 into sparklemotion:master Jan 6, 2016
@flavorjones
Copy link
Member

Great, thanks for following up and making this change!

@flavorjones flavorjones added this to the 1.6.8 milestone Jan 11, 2016
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