README-profiling.md
make bench to run Go benchmarks for MillerRun the profiler:
mlr --cpuprofile cpu.pprof --csv put -f scripts/perf/chain-1.mlr ~/data/big.csv > /dev/null
(or whatever command-line flags for Miller).
Text mode:
go tool pprof mlr cpu.pprof
top10
Graphical mode:
go tool pprof -http=:8080 cpu.pprof
and let it pop open a browser window. Then navigate there -- I personally find View -> Flame Graph most useful:
Note that you can drill into subcomponents of the flame graph:
Scripts:
mlr cat for million-record files of various file formats. Catting files isn't intrinsically interesting but it shows how input and output processing vary over file formats.scripts/perf/chain-1.mlr, showing how Miller handles multicore and concurrency.scripts/perf/make-data-stream | mlr ... then look at htop in another window.Notes:
mlr5 and ~/tmp/miller/mlr as well as ./mlr. The idea is I have a copy of Miller 5.10.3 (the C implementation) saved off in my path as mlr5. Then I keep ~/tmp/miller on recent HEAD. Then I have . on a dev branch. Comparing mlr5 to ./mlr shows relative performance of the C and Go implementations. Comparing ~/tmp/miller/mlr to ./mlr shows relative performance of whatever optimization I'm currently working on.# Note 100 is the default
# Raise the bar for GC threshold:
GOGC=200 GODEBUG=gctrace=1 mlr -n put -q -f u/mand.mlr 1> /dev/null
# Raise the bar higher for GC threshold:
GOGC=1000 GODEBUG=gctrace=1 mlr -n put -q -f u/mand.mlr 1> /dev/null
# Turn off GC entirely and see where time is spent:
GOGC=off GODEBUG=gctrace=1 mlr -n put -q -f u/mand.mlr 1> /dev/null