Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is part of an effort to do some CPU profiling of the Wirey binary. This will bring visibility into Wirey's "hot" functions and how we can go about optimizing the code better. (hot refers to the most frequently invoked functions.)
First deploy this binary into production. Then, we can see the following:
CPU profile: curl http://localhost:6060/debug/pprof/profile?seconds=30 (Collects 30 seconds of CPU profiling data)
Heap profile: curl http://localhost:6060/debug/pprof/heap
Goroutine profile: curl http://localhost:6060/debug/pprof/goroutine
It can also create a Flame graph to indicate the most frequently used functions across the call stack.
What is paramount here is that the CPU profiling is done on a production load, so that the optimizations derived from this effort impact usage behavior of actual users of Wirey.
BTW:
With Profile Guided Optimization (PGO), Golang will also perform optimizations on such "hot" functions and give you back data about the performance increase it might've yielded. Optimizations refer to compiler passes such as inlining, constant folding, etc etc
We can run profiling as optional setting like so:
./myapp -enable-profiling=true -profile-addr="localhost:6061"