Thanks for the geeks on the lists who pointed out a lot of problems to
me.
I want to add the description why I want to make this benchmark. And I
tried to use mmap() for reading file but I have got no benefits from it.
https://blog.cloudcache.net/why-mmap-has-no-significant-effect-in-my-code/
On Sat, Jan 15, 2022 at 5:03 AM Jon Smart 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
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
On 15.01.2022 17:57, Paul Procacci wrote:
Hey John,
One more follow up and then it's bedtime for me.
Sorry, it's 5:00am here and needless to say it's wy past my bedtime and
I'm making mistakes.
The comparison should have been between both ruby versions ugh.
I'll let you play though. Have a great night.
On Sat, Jan 15, 2022 at 4:57 AM Paul Procacci wrote:
> Hey John,
>
> One more foll
Hey John,
One more follow up and then it's bedtime for me. I wanted to further this
discussion just a little bit more by implementing the mmap solution that I
applied to perl to ruby instead. Now all of a sudden, ruby is much much
faster. My ruby source code follows:
Goodnight!
# ruby -W0 ./d
Hey John,
On Sat, Jan 15, 2022 at 3:04 AM Jon Smart wrote:
>
> Hello Paul
>
> Do you mean by undef $/ and with <$fh> we can read the file into memory
> at one time?
>
In most cases the short answer is yes.
I have problems with your wording however given the 'geek' that I am. 'At
one time'
Hello Paul
Do you mean by undef $/ and with <$fh> we can read the file into memory
at one time?
Yes that would be faster b/c we don't need to read file by each line,
which increases the disk IO.
Another questions:
1. what's the "truss" command?
2. what's the syntax "<:mmap"?
Thank you.
O
Hey Jon,
The most glaringly obvious thing I could recommend is that at least in your
perl routine (and probably the other languages) most of your time is
context switching reading from the disk.
Now, my perl version is indeed faster, but one has to ask themselves, was
.015193256 seconds really wor