develooper Front page | perl.beginners | Postings from January 2022

Re: Benchmark for Scala, Ruby and Perl

Thread Previous
From:
Paul Procacci
Date:
January 17, 2022 18:18
Subject:
Re: Benchmark for Scala, Ruby and Perl
Message ID:
CAFbbPujuiffwhqovwQSCgkS7w2nqXCMxnZW2HFxBLYX7y2nw6g@mail.gmail.com
On Sat, Jan 15, 2022 at 5:03 AM Jon Smart <jon@smartown.nl> wrote:

>
> Thanks Paul. I am surprised that mmap has that huge IO advantages
> comparing to the classic way. So ruby take more benefit from this mmap
> calling. Just get learned from your case.
>
> Regards
>
>
It's not always beneficial.  There are cases where one is more beneficial
over the other.
..... and unfortunately it's not really well defined when to use one over
the other.

The general consensus has been that if you plan on jumping around a lot in
a file, then mmap will be superior to read.
Otherwise when sequentially reading, then read will be superior to mmap.

The inclusion of my perl mmap version clearly disproves that ON MY OS.
It may be different ON YOUR OS.

This is partially why micro benchmarking is hard to do.  Your scripts will
almost certainly act one way on your machine, and different on others.
You may very well try an mmap version on your machine and scratch your head
because it's slower .... there's more than just the userland processes
involved here.  ;)

Goodnight (again).

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About