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

basename: Improve performance and style #80

Merged
merged 1 commit into from
Jun 23, 2016

Conversation

glebm
Copy link
Contributor

@glebm glebm commented Jun 23, 2016

More idiomatic, slightly faster, extracted from #66

$  WITH_REGRESSION=1 rake pbench
Pinch-bench (Pbench) by Daniel P. Clark
--------------------------------------------------------------------------------
64-bit ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
64-bit rustc 1.9.0 (e4e8b6668 2016-05-18)
--------------------------------------------------------------------------------
Performance change for allocate, instead of new, is 80.1%
Performance change for absolute? is 92.8%
Performance change for add_trailing_separator is 55.3%
Performance change for basename is 6.3%
Performance change for chop_basename is 26.6%
Performance change for directory? is 32.6%
Performance change for extname is 51.1%
Performance change for has_trailing_separator? is 52.1%
Performance change for blank? (verses strip.empty?) is -93.9%
Performance change for relative? is 92.2%
Started with run options --seed 51653

More idiomatic, faster, extracted from danielpclark#66
@danielpclark
Copy link
Owner

Awesome!

@danielpclark danielpclark merged commit 3acbdac into danielpclark:master Jun 23, 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