Skip to content

Instantly share code, notes, and snippets.

@Xliff
Last active April 10, 2019 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xliff/ce03bf24897d3b6c86333014c35fd3d5 to your computer and use it in GitHub Desktop.
Save Xliff/ce03bf24897d3b6c86333014c35fd3d5 to your computer and use it in GitHub Desktop.
A long compile time...

This module took an obscenely long to compile:

$ perl6 --stagestats -I../p6-Pango/lib -I../p6-GtkPlus/lib -Ilib -e 'use GTK'
Stage start      :   0.000
Stage parse      : 1206.234
Stage syntaxcheck:   0.000
Stage ast        :   0.000
Stage optimize   :   0.000
Stage mast       :   0.002
Stage mbc        :   0.000
Stage moar       :   0.000

For comparison, here is how long it takes given an optimal build order:

Stage start      :   0.000
Stage parse      :   9.208
Stage syntaxcheck:   0.000
Stage ast        :   0.000
Stage optimize   :   0.002
Stage mast       :   0.008
Stage mbc        :   0.001
Stage moar       :   0.000

The only module that really needed to be recompiled was GTK::TextView. Its timings are:

Stage start      :   0.000
Stage parse      :   5.279
Stage syntaxcheck:   0.000
Stage ast        :   0.000
Stage optimize   :   0.002
Stage mast       :   0.011
Stage mbc        :   0.001
Stage moar       :   0.000

After making a few changes in GTK::TextBuffer, timings to recompile again are. Note that GTK::TextBuffer is the only file to be changed, yet the entire project takes this long to compile:

$ perl6 --stagestats -I../p6-Pango/lib -I../p6-GtkPlus/lib -Ilib t/02-search.t 
Stage start      :   0.000
Stage parse      : 1187.174
Stage syntaxcheck:   0.000
Stage ast        :   0.000
Stage optimize   :   0.042
Stage mast       :   0.091
Stage mbc        :   0.008
Stage moar       :   0.000

For what its worth, here is the critical depenedency chain: t/02-search.t -> GTK::Builder -> GTK -> GTK::TextBuffer. So making a change in GTK::TextBuffer incurs a compile-time cost of over 21 minutes!

So is this a regressionin perl6 compile times, or maybe a bug in how need statements are processed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment