Skip to content

Conversation

@Ice3man543
Copy link
Member

Uses an optimization to keep only two arrays + other misc changes

Benchmarks:

$ go test -bench=. -benchmem -memprofile=allocs
goos: darwin
goarch: amd64
pkg: github.com/projectdiscovery/utils/strings
cpu: VirtualApple @ 2.50GHz
BenchmarkLongestRepeatingSequence-10              171566              6612 ns/op           15584 B/op         61 allocs/op
BenchmarkLongestRepeatingSequenceNew-10              360710              3129 ns/op             704 B/op          2 allocs/op +++
PASS
ok      github.com/projectdiscovery/utils/strings       1.851s

…tions

Uses an optimization to keep only two arrays + other misc changes.

Benchmarks:

$ go test -bench=. -benchmem -memprofile=allocs
goos: darwin
goarch: amd64
pkg: github.com/projectdiscovery/utils/strings
cpu: VirtualApple @ 2.50GHz
BenchmarkLongestRepeatingSequence-10              171566              6612 ns/op           15584 B/op         61 allocs/op
BenchmarkLongestRepeatingSequenceNew-10              360710              3129 ns/op             704 B/op          2 allocs/op +++
PASS
ok      github.com/projectdiscovery/utils/strings       1.851s
@Ice3man543 Ice3man543 changed the title feat: improve LongestRepeatingSequence performance by reducing allocas feat: improve LongestRepeatingSequence performance by reducing allocs Nov 29, 2024
@ehsandeep ehsandeep merged commit cebafa1 into main Dec 1, 2024
7 checks passed
@ehsandeep ehsandeep deleted the pprof-server-add branch December 1, 2024 13:23
@ehsandeep ehsandeep removed the request for review from dogancanbakir December 1, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants