develooper Front page | perl.perl5.porters | Postings from October 2018

[perl #133511] [PATCH] tiny optimization of pp_divide

Thread Next
Tony Cook via RT
October 11, 2018 23:57
[perl #133511] [PATCH] tiny optimization of pp_divide
Message ID:
On Tue, 11 Sep 2018 22:52:46 -0700, wrote:
> This patch marginally speed-ups division of large integers in perl. The
> change is extremely simple and explained in the commit message:

Perhaps it could use a comment indicating that many modern optimizing compilers combine the div and mod into one instruction.

I could see myself seeing that code in a few years and wondering it was using a (relatively) slow[1] div rather than a mul.

If I go to an older compiler like clang 4.0.1, I end up with two div instructions with your patch rather than a div and a mul.


[1] see the latencies for mul vs div on SkylakeX at for example.

via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About