You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using HasSuffix is O(len(suffix)) rather than O(len(path)) for filepath.Base.
path usually does not have a / prefix. So 1:1 replacement of filepath.Base(p) == x to strings.HasSuffix(p, x) won't work. But something like strings.HasSuffix("/"+p, x) could work. It's unclear how much the string concatenation costs.
This needs more benchmarking and one refactoring of the code base.
The text was updated successfully, but these errors were encountered:
The path in FileRequired has / even on windows. This is because the walk function uses path.Join.
http://google3/third_party/scalibr/extractor/filesystem/internal/walkdir_iterate.go;l=73;rcl=680571378
Using HasSuffix is O(len(suffix)) rather than O(len(path)) for filepath.Base.
path usually does not have a / prefix. So 1:1 replacement of
filepath.Base(p) == x
tostrings.HasSuffix(p, x)
won't work. But something likestrings.HasSuffix("/"+p, x)
could work. It's unclear how much the string concatenation costs.This needs more benchmarking and one refactoring of the code base.
The text was updated successfully, but these errors were encountered: