Closed inteon closed 3 months ago
The following snippet causes unexpectedly high memory usage:
func BenchmarkParseSubject(b *testing.B) { for n := 0; n < b.N; n++ { _, err := ldap.ParseDN("DF=#6666666666665006838820013100000746939546349182108463491821809FBFFFFFFFFF") if err == nil { b.Fatal("expected error, but got none") } } }
Run with:
go test -bench=. -benchmem .
Result:
goos: darwin goarch: arm64 pkg: . BenchmarkParseSubject-12 58 20398892 ns/op 1665740367 B/op 58 allocs/op
The following snippet causes unexpectedly high memory usage:
Run with:
Result: