mirror of
https://github.com/ruby/ruby.git
synced 2026-07-31 09:25:15 +08:00
pathname: Add simple benchmarks
This commit is contained in:
parent
407398b079
commit
6f8ece0690
Notes:
git
2026-05-13 08:39:00 +00:00
15
benchmark/pathname.yml
Normal file
15
benchmark/pathname.yml
Normal file
@ -0,0 +1,15 @@
|
||||
prelude: |
|
||||
abs = Pathname("/a")
|
||||
rel = Pathname("a")
|
||||
p1 = Pathname.new('foo/././././bar')
|
||||
p2 = Pathname.new('foo/bar/./../..')
|
||||
p3 = Pathname.new('foo/bar/zot')
|
||||
benchmark:
|
||||
p1+p2: p1+p2
|
||||
abs.root?: abs.root?
|
||||
rel.root?: rel.root?
|
||||
abs.absolute?: abs.absolute?
|
||||
rel.absolute?: rel.absolute?
|
||||
p1.cleanpath: p1.cleanpath
|
||||
p2.cleanpath: p2.cleanpath
|
||||
relative_path_from: p3.relative_path_from('foo/bar/qux/quax')
|
||||
Loading…
x
Reference in New Issue
Block a user