Compare commits

...

3 Commits

Author SHA1 Message Date
Artur Melanchyk
8020d98a2d
Merge 8fe5246e5b845f2ae8ec42b6a414ec8979793985 into 915e4c90d28ec4cffc6eb146e208ab5a65eac772 2025-12-28 20:58:35 +08:00
Artur Melanchyk
8fe5246e5b
Merge branch 'master' into master 2025-12-24 13:05:13 +01:00
Artur Melanchyk
bd2679c647 perf(tree): reduce allocations in findCaseInsensitivePath 2025-11-01 19:59:30 +01:00

View File

@ -671,12 +671,7 @@ walk: // Outer loop for walking the tree
func (n *node) findCaseInsensitivePath(path string, fixTrailingSlash bool) ([]byte, bool) {
const stackBufSize = 128
// Use a static sized buffer on the stack in the common case.
// If the path is too long, allocate a buffer on the heap instead.
buf := make([]byte, 0, stackBufSize)
if length := len(path) + 1; length > stackBufSize {
buf = make([]byte, 0, length)
}
buf := make([]byte, 0, max(stackBufSize, len(path)+1))
ciPath := n.findCaseInsensitivePathRec(
path,