1
1
mirror of https://github.com/walles/moar.git synced 2024-08-16 23:40:35 +03:00

README: Improve profiling section

This commit is contained in:
Johan Walles 2022-10-30 00:54:22 +02:00
parent 6a44c61809
commit 62322e6cc0

View File

@ -165,6 +165,13 @@ Run microbenchmarks:
go test -benchmem -run='^$' -bench=. . ./...
```
Profiling `BenchmarkPlainTextSearch()`. Try replacing `-alloc_objects` with
`-alloc_space` or change the `-focus` function:
```bash
go test -memprofilerate 1 -memprofile memprofile.out -benchmem -run='^$' -bench '^BenchmarkPlainTextSearch$' github.com/walles/moar/m && go tool pprof -alloc_objects -focus findFirstHit -relative_percentages -web memprofile.out
```
Build + run:
```bash