Please give this a try:
env RAKUDO_MODULE_DEBUG=1 perl6 GetUpdates.pl6
and tell me if any of the lines it spits out takes considerable amounts
of time before the next one shows up.
Then, you can also
strace -e stat perl6 GetUpdates.pl6
to see if it's going through a whole load of files.
without the "-e stat" you will get a whole lot more output, but it'll
tell you pretty much everything that it's asking the kernel to do.
Pasting that whole file could be a privacy concern, especially if it
iterates your entire home directory, which is still my working hypothesis.
HTH
- Timo
On 28/04/2019 08:41, ToddAndMargo via perl6-users wrote:
> On 21/04/2019 05:58, ToddAndMargo via perl6-users wrote:>> Hi All,
>>
>> One liners are fast, but my own programs are very slow to start.
>>
>> I download
>>
>> https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6
>>
>> To check it out and it also takes ten second to start.
>>
>> What gives?
>>
>> Many thanks,
>> -T
On 4/27/19 11:14 PM, Timo Paulssen wrote:
You don't happen to have a PERL6LIB or -I pointed at a folder with
loads of stuff in it? If that is the case, having a single "use"
statement will cause rakudo to iterate through all files and
subfolders, which can take a long time if you've got, for example,
your home directory in that list (be it via -I. or PERL6LIB=. or
explicitly mentioning the big folder)
There's many different tools to find out what's going on. For the
"too big perl6lib folder" problem, "strace" will give you a good hint
by giving one "stat" command for every file under your home directory.
Other than that, check "perl6 --stagestats -e 'blah'" or "perl6
--stagestats FooBar.p6", which will give timings for the different
phases, most notably "parse", "optimize", and "mbc". loading modules
and precompiling are part of the parse stage.
the "time" command will split your run time between "system" and
"user" time (as well as wallclock time). if "system" is particularly
high, then the program spends a lot of time asking the kernel to do
stuff (such as iterating files on the filesystem for the PERL6LIB
case i've menitoned above).
If none of that helps, startup can be profiled with "perl6
--profile-compile blah" and run time can be profiled with "perl6
--profile blah". The default output will be a html file that you can
just open in your browser to get an interactive performance
inspection tool thingie. Be aware, though, that it can become very
big in the case of --profile-compile, depending on the structure of
the program being compiled.
Hope any of that helps
- Timo
Hi Timo,
This tell you anything?
$ perl6 --stagestats GetUpdates.pl6
Stage start : 0.000
Stage parse : 13.150
Stage syntaxcheck: 0.000
Stage ast : 0.000
Stage optimize : 0.351
Stage mast : 1.133
Stage mbc : 0.019
Stage moar : 0.000
GetUpdates.pl6 <-- my program starts here
Mozilla Mirror <releases.mozilla.org>
Debug is OFF
The "Stage parse : 13.150" is eating me alive!
-T