FAQ
However, there's something strange, at least on my machine:

$ time(gotip build -a -gcflags='-cpuprofile=/tmp/cpu.prof' std)

real 0m15.414s
user 0m46.176s
sys 0m2.040s

so 15 seconds of compilation, but then on

$ gotip tool pprof ~/go/pkg/tool/linux_amd64/compile /tmp/cpu.prof

(pprof) top10
70ms of 70ms total ( 100%)
Showing top 10 nodes out of 54 (cum >= 50ms)
       flat flat% sum% cum cum%
       20ms 28.57% 28.57% 20ms 28.57% runtime.mCentral_Grow
       10ms 14.29% 42.86% 10ms 14.29% cmd/compile/internal/gc.yylex
       10ms 14.29% 57.14% 10ms 14.29% runtime.atomicload
       10ms 14.29% 71.43% 10ms 14.29% runtime.memclr

only 70 cumulative ms of run time? How's that possible?
On Monday, October 19, 2015 at 10:25:51 PM UTC+2, Dave Cheney wrote:

The compiler also supports various profiling flags, see go tool
compile -help, which will let it write out the usual profile files.
For example

go build -gcflags='-cpuprofile=/tmp/c.p' $SOMEPKG

Will generate a cpu profile which can be interogated with

go tool pprof $GOROOT/pkg/tool/$GOOS_GOARCH/compile /tmp/c.p

Please let me know if you have trouble with these steps

Dave

On Tue, Oct 20, 2015 at 3:46 AM, Ian Lance Taylor <ia...@golang.org
<javascript:>> wrote:
On Mon, Oct 19, 2015 at 12:24 AM, Kiswono Prayogo <kis...@gmail.com
<javascript:>> wrote:
How to trace the compilation process? (which part that slow)
Since the current compiler is written in Go, start with
http://blog.golang.org/profiling-go-programs .

Ian

--
You received this message because you are subscribed to the Google
Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to golang-dev+...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 14 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 8, '15 at 9:04p
activeOct 25, '15 at 10:06a
posts14
users8
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase