added profiling commands to Makefile

This commit is contained in:
z7zmey 2018-06-05 00:09:21 +03:00
parent d67d45948a
commit 112ef18501
2 changed files with 18 additions and 1 deletions

7
.gitignore vendored
View File

@ -1,3 +1,8 @@
.vscode
php-parser
*example.php
*example.php
cpu.prof
mem.prof
php7.test
php5.test

View File

@ -32,3 +32,15 @@ compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go
./php7/php7.go: ./php7/php7.y
goyacc -o $@ $<
profile5:
GOGC=off go test -cpuprofile cpu.prof -memprofile mem.prof -bench=. -benchmem -benchtime=20s ./php5
profile7:
GOGC=off go test -cpuprofile cpu.prof -memprofile mem.prof -bench=. -benchmem -benchtime=20s ./php7
cpu_pprof:
go tool pprof cpu.prof
mem_pprof:
go tool pprof mem.prof