bazelbuild / bazel-skylib

Common useful functions and rules for Bazel
https://bazel.build/
Apache License 2.0
376 stars 179 forks source link

paths method performance #487

Open jbedard opened 5 months ago

jbedard commented 5 months ago

A lot of the paths methods are significantly slower then they could be.

I've found when invoked frequently (such as once per path in a large glob result) doing simple string manipulation is sometimes 10-100x faster (300+s to <10s in some instances). Primarily methods such as paths.replace_extension and paths.split_extension, and the underlying paths.basename. I think the primary reason being the creation of arrays/tuples only to extract a single string out of the array?