hodgesds / perf-utils Goto Github PK
View Code? Open in Web Editor NEWPerf Utilities for Go
License: MIT License
Perf Utilities for Go
License: MIT License
I would like to use your library to count cycles and instructions as a part of a standard Go benchmark for one of my projects. Unfortunately, the current work flow seems to be not as useful as it could be for this purpose: the profileFn
function performs the thread locking and set up in one go, causing all the cost for this to become part of the allocation and time counts measured by the benchmark. Additionally, the current set up only allows taking one performance counter per benchmark when taking multiple counters would be a lot more useful.
I think it would be nice to have a function with a signature like this:
func RunBenchmark(b *testing.B, f func(b *testing.B), unix.PerfEventAttr...)
This function would do the following:
b.StopTimer(); b.ResetTimer()
f
once for each PerfEventAttr
and add the results (divided by b.N
) to the benchmark using b.ReportMetric
f
once more surrounded by b.StartTimer()
and b.StopTimer
to get timings and GC usage (optionally do this first?)b.Fatal()
What do you think about something like this? Alternatively or additionally, a benchmark setup function (using b.Cleanup
to automatically clean up) and a setup-less profileFn
variant could be provided.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.