Comments (5)
$ TDINPUT=input.td go test -cpuprofile cpu.out -bench=Preall -benchtime=5s
...
# --nodefraction tells pprof to ignore nodes that take less than 5% of the
# total time - this significantly reduces the clutter in the produced graph
$ go tool pprof --nodefraction=0.05 ./example.com.test cpu.out
...
(pprof) web
from go-recipes.
$ TDINPUT=input.td go test -memprofile=mem.mprof -bench=Preall -benchtime=5s
...
$ go tool pprof --alloc_objects example.com.test mem.mprof
...
(pprof) list scanIdentifier
Total: 27388406
ROUTINE ======================== example%2ecom.(*Lexer).scanIdentifier
21501647 21501647 (flat, cum) 78.51% of Total
. . 238:func (lex *Lexer) scanIdentifier() Token {
. . 239: startpos := lex.rpos
. . 240: for isAlpha(lex.r) || isDigit(lex.r) {
. . 241: lex.next()
. . 242: }
21501647 21501647 243: return Token{IDENTIFIER, string(lex.buf[startpos:lex.rpos]), startpos}
. . 244:}
. . 245:
. . 246:func (lex *Lexer) scanNumber() Token {
. . 247: startpos := lex.rpos
. . 248: for isDigit(lex.r) {
from go-recipes.
https://eli.thegreenplace.net/2022/a-faster-lexer-in-go/
from go-recipes.
https://go.dev/doc/diagnostics#runtime
from go-recipes.
from go-recipes.
Related Issues (20)
- Avoid recompiling in go test
- how to collect statistics on line in source code been reached or not at runtime
- https://github.com/omissis/go-jsonschema
- https://github.com/devnev/refdir
- https://github.com/nickwells/utilities/tree/master/gosh
- https://github.com/uber-go/nilaway
- https://github.com/shopspring/go-tools/tree/master/cmd/keyify
- https://github.com/nikolaydubina/go-bitset-example
- https://github.com/jgautheron/goconst
- https://www.uber.com/en-AE/blog/nilaway-practical-nil-panic-detection-for-go/
- https://github.com/bracesdev/errtrace
- https://gokrazy.org/quickstart/
- https://go.dev/blog/deadcode
- https://github.com/nalgeon/codapi
- how to check if symbol or package is included in binary?
- https://gotraceui.dev
- script for automatic go repo status checking
- https://github.com/fe3dback/go-arch-lint
- https://go.dev/blog/execution-traces-2024
- https://github.com/zarldev/goenums
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-recipes.