No such thing as a small change | |
PerlMonks |
Camel vs. Gopherby reisinge (Hermit) |
on Dec 08, 2018 at 19:16 UTC ( [id://1226977]=perlmeditation: print w/replies, xml ) | Need Help?? |
I've been using Perl for several years mostly for small to medium sized programs of sysadmim type (automation, gluing, data transformation, log searching). Recently I started to learn Go. I wanted to write something in both languages and compare. Here goes. The Perl code is more than 2 times smaller:
Perl code is more than 4 times slower when run ...
... and more than 5 times slower when I built the Go code:
The code generates 10 million random integers from 0 to 9. Than it counts the occurrence of each generated integer and prints it.
In conclusion I must say that I like both languages. I like beer too :-).
Always rewrite your code from scratch, prefefably twice. -- Tom Christiansen
Back to
Meditations
|
|