pathname: Add simple benchmarks

This commit is contained in:
Nobuyoshi Nakada 2026-05-07 18:05:19 +09:00 committed by Nobuyoshi Nakada
parent 407398b079
commit 6f8ece0690
Notes: git 2026-05-13 08:39:00 +00:00

15
benchmark/pathname.yml Normal file
View 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')