Re: Benchmark for Scala, Ruby and Perl

2022-01-17 Thread Paul Procacci
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

Re: Benchmark for Scala, Ruby and Perl

2022-01-17 Thread Paul Procacci
last; } $i ++; } On Sat, Jan 15, 2022 at 12:37 AM Jon Smart wrote: > Hello, > > May I show the result of my benchmark for perl5, ruby, and scala? > https://blog.cloudcache.net/benchmark-for-scala-ruby-and-perl/ > > Welcome you to give any suggestion to me for improving this. > > Thanks. > -- __ :(){ :|:& };:

Re: Benchmark for Scala, Ruby and Perl

2022-01-17 Thread Paul Procacci
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'

Re: Benchmark for Scala, Ruby and Perl

2022-01-17 Thread Paul Procacci
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

Re: Benchmark for Scala, Ruby and Perl

2022-01-17 Thread Paul Procacci
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

Re: Benchmark for Scala, Ruby and Perl

2022-01-16 Thread Alex Mestiashvili
On 1/15/22 06:37, Jon Smart wrote: Hello, May I show the result of my benchmark for perl5, ruby, and scala? https://blog.cloudcache.net/benchmark-for-scala-ruby-and-perl/ Welcome you to give any suggestion to me for improving this. Thanks. The data is way to small tbh

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread Jon Smart
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/

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread John W. Krahn
On 2022-01-15 00:04, Jon Smart wrote: Hello Paul Do you mean by undef $/ and with <$fh> we can read the file into memory at one time? $/ is the input record separator, newline by default. If undefined that means that the whole file is treated as one single record. Yes that would be faster

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread Jon Smart
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.

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread Jon Smart
) { if ($i < 20) { print "$_ -> $count{$_}\n" } else { last; } $i ++; } On Sat, Jan 15, 2022 at 12:37 AM Jon Smart wrote: Hello, May I show the result of my benchmark for perl5, ruby, and scala? https://blog.cloudcache.net/benchmark-for-scal

Benchmark for Scala, Ruby and Perl

2022-01-14 Thread Jon Smart
Hello, May I show the result of my benchmark for perl5, ruby, and scala? https://blog.cloudcache.net/benchmark-for-scala-ruby-and-perl/ Welcome you to give any suggestion to me for improving this. Thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e