Re: What can effect perl startup time?
by GrandFather (Saint) on Mar 23, 2022 at 01:57 UTC
|
If I understand you correctly you are suggesting a load/execute time of the order of 5ms. That is comparable with hard drive (spinning rust version) seek times. So what you are measuring is simply the OS's overhead for loading and executing Perl and Perl's overhead for loading, compiling and executing your script. Given your script is essentially a no-op, you are asking us to guess why your OS and hardware are performing differently than some other past combination you had. We are supposed to do that how? And it matters why?
If you are running a web server and that represents overhead in page fetches there are ways to mitigate the problem. Is that the question you should be asking?
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
| [reply] |
|
Some of it is out of curiosity and some of it is is I have a shell function wrapping a perl script which does tab completion and I wanted to get a baseline.
My m1 mac is almost 100% faster: 0.21s user 0.13s system 85% cpu 0.399 total
Given the non-difference between my 2020 imac and 2014 imac, I'm wondering if I might have something configured in a way that is slowing things down. Both are running SSD drives but the 2020 machine has a very beefy processor. So that leads me to believe there is some kind of bottleneck on the newer mac. Maybe it's the OS version (Big Sur vs. Monterey). But the m1 and the 2020 imac are running the same OS version and there is a huge difference.
So I'm very curious to know what might explain the similar times between the older mac and the newer one.
| [reply] [d/l] |
Re: What can effect perl startup time?
by Fletch (Bishop) on Mar 23, 2022 at 02:04 UTC
|
I can’t recall the dtruss equivalent, but were I looking at this my first inclination would be to get an strace with full timing info including the length of time spent in each system call and then start comparing. You don’t say if there’s differing OS versions installed, but changes in the runtime, standard libraries, third-party but linked in libs, yadda yadda yadda . . . . Handwaving for sure but ballpark two hundredths of a second difference doesn’t strike me as completely outside the realm of what I’d consider a reasonable “expected variation”.
Edit: and I’m basing that .02 difference as .74 vs .72 rounded
The cake is a lie.
The cake is a lie.
The cake is a lie.
| [reply] [d/l] [select] |
|
Yeah, I'm inclined to believe all the software installed on the newer mac is somehow bogging things down. The older mac is basically stock with very few apps installed.
Looks like I will have to jump through security hoops to run strace/dtruss. While I"m curious, I'm not that curious to do all that and then only find out that I have no idea what I'm looking at and going down that rabbit hole. A project for a very rainy day, I suppose.
| [reply] |
Re: What can effect perl startup time?
by roho (Bishop) on Mar 23, 2022 at 05:01 UTC
|
Slightly OT. First, a disclaimer: I am not an English teacher nor the child of an English teacher, but 'affect' and 'effect' are two of the most commonly confused words in the English language. (Sorry - slow night here - filling the time gaps with grammatical trivia.)The Merriam-Webster web site offers this hint on how to distinguish between the two and use the correct one:
Affect is usually a verb meaning "to produce an effect upon," as in "What can affect Perl startup time?" Effect is usually a noun meaning "a change that results when something is done or happens," as in "computers have had a huge effect on our lives." There are exceptions, but if you think of affect as a verb and effect as a noun, you’ll be right a majority of the time."
"It's not how hard you work, it's how much you get done."
| [reply] |
|
| [reply] |
|
It sure can affect one's ability to write :). I've worked through many a night with diminishing returns and watched the sun rise.
"It's not how hard you work, it's how much you get done."
| [reply] |
|
| [reply] |
Re: What can effect perl startup time?
by nysus (Parson) on Mar 23, 2022 at 02:25 UTC
|
OK, mystery solved. Seems the Comma IDE left a zombie rakudo process running after I shut it down which was eating 100% CPU. So on the newer mac I now I get:
0.34s user 0.17s system 82% cpu 0.615 total
Which is much more inline with expectations.
| [reply] [d/l] |