On 2020-04-01 04:37, Tessa Plum wrote:
On 2020/4/1 4:09 下午, ToddAndMargo via perl6-users wrote:
raku --optimize=0 FileAttributes.pl6
I never used this argument. what does it bring to us?
Thanks.
Hi Tessa,
I am not exactly sure what it does. "Optimize"
typically works at the lower level parts of
the resulting code, usually the assembly
code level. It is looking for faster ways of
doing what you want. For exactly what is going
on here, one of the developers would need to
chime in.
And, it does do wonders. But, since it does not
know your reason for asking for what you are asking,
sometimes it comes up with 2+2=3, but faster.
So, If what you are asking just does not seems to
be what you are getting and it does not match
your one line modules. Try turning off the optimizer.
Back "in the day" when I programmed exclusively in
Module 2, I had to disable the optimizer on a
permanent basis. I got a lot of 2+2=5's if
I did not.
With the project I am working on now, setting the
optimizer to zero helped "somewhat". There were
other problems as well.
One of the more obvious problems it did help with
was "sleep 10". Because my code takes over 10
seconds to compile, it included the compile time
as part of the wait. So the first sleep 10 got
blasted past, but the rest of my sleep/s got
honored, so long as there was other code between
them.
Oh and
sleep 1; sleep 10
got optimized into one single
sleep 0
So, if you are chasing ghosts, try turning off
the optimizer.
-T