Skip Menu |
Report information
Id: 131626
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [PERF] ≥ and ≤ are 36x slower than Texas version; ≠ is 15x slower
Download (untitled) / with headers
text/plain 668b
I'd expect the fancy Unicode versions of <=, >=, and != to perform equally well, instead the ≥ and ≤ are 36x slower than their Texas companions and ≠ is 15x slower. Here's the timings for >= vs ≥: m: my $x = rand; for ^1000_000 { $ = $x >= 1_000_000_000_000 }; say now - INIT now; rakudo-moar 43c176: OUTPUT: «0.74663187␤» m: my $x = rand; for ^1000_000 { $ = $x ≥ 1_000_000_000_000 }; say now - INIT now; rakudo-moar 43c176: OUTPUT: «(timeout)» m: my $x = rand; for ^1000_0 { $ = $x ≥ 1_000_000_000_000 }; say now - INIT now; rakudo-moar 43c176: OUTPUT: «0.2661272␤» m: say 0.2661272*100 / 0.729002 rakudo-moar 43c176: OUTPUT: «36.505689␤»
This was discussed in https://github.com/rakudo/rakudo/pull/1032#issuecomment-284217342

In theory, this ticket should apply for other ops as well.

Note that I said that I will change the way unicode ops are implemented, but I didn't have much time since then. Hoping to get to it at some point.

On 2017-06-22 10:29:59, cpan@zoffix.com wrote:
Show quoted text
> I'd expect the fancy Unicode versions of <=, >=, and != to perform
> equally well, instead the
> ≥ and ≤ are 36x slower than their Texas companions and ≠ is 15x
> slower.
>
> Here's the timings for >= vs ≥:
>
> m: my $x = rand; for ^1000_000 { $ = $x >= 1_000_000_000_000 }; say
> now - INIT now;
> rakudo-moar 43c176: OUTPUT: «0.74663187␤»
> m: my $x = rand; for ^1000_000 { $ = $x ≥ 1_000_000_000_000 }; say now
> - INIT now;
> rakudo-moar 43c176: OUTPUT: «(timeout)»
> m: my $x = rand; for ^1000_0 { $ = $x ≥ 1_000_000_000_000 }; say now -
> INIT now;
> rakudo-moar 43c176: OUTPUT: «0.2661272␤»
> m: say 0.2661272*100 / 0.729002
> rakudo-moar 43c176: OUTPUT: «36.505689␤»




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org