It’s really in the dispatch within Cool. Note the difference between:
for ^1 { 1.match(/1/) }
and:
for ^1 { "1".match(/1/) }
I’m afraid this is really uncovering a basic dispatch caching issue.
I have tried a few things, but I’m afraid this is really an issue inside
It’s really in the dispatch within Cool. Note the difference between:
for ^1 { 1.match(/1/) }
and:
for ^1 { "1".match(/1/) }
I’m afraid this is really uncovering a basic dispatch caching issue.
I have tried a few things, but I’m afraid this is really an issue inside
Oh! You're totally right!
Then, it's not as bad as it looks.
In fact, this commit actually *improved* the case when it has to match Str-s
(more than 2x speedup).
So perhaps the slowdown is not so critical. After all, how often do people
match thousands of Ints…
On 2017-07-26 23:55:21,
Looking at the profile of
(^1).grep({!/1/}).elems.say
the first 5 entries (responsible for 70% of CPU in that example) have nothing
to do with matching, but everything with trying to find the right dispatchee.
And it looks like this is basically caused by:
$_ = 1; /1/
Because $_
Looking at the profile of
(^1).grep({!/1/}).elems.say
the first 5 entries (responsible for 70% of CPU in that example) have nothing
to do with matching, but everything with trying to find the right dispatchee.
And it looks like this is basically caused by:
$_ = 1; /1/
Because $_
# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev
# Please include the string: [perl #131805]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=131805 >
See this benchable6 output: