4 ms·
One night for fun, I wrote a fizzbuzz (without actual printing) in almost all of the languages mentionned here (except fortran), and benchmarked it with 10000 e
by jrimbault 9y ago
One night for fun, I wrote a fizzbuzz (without actual printing) in almost all of the languages mentionned here (except fortran), and benchmarked it with 10000 executions each.
- sevensor 9y agoAnd? Don't leave us hanging! Who wins at FizzBuzz? Also, surely 10k is just getting started?
- jrimbault 9y ago10k was just sufficient to get actual differences. Of course I went crazy and did something like 10M, but waiting 10 minutes to get the same relative differences didn't bring anything. Remember this is without any printing: C is fast, if I remember correctly it was something like 0.015 or 0.03s while at the other end of the spectrum I had to wait 0.1s for JavaScript. C results varied from simple to double because of the OS I guess because it was so quick. It isn't a really significant benchmark though, for any language. It was one of those nights. Ah, and I remember a large difference between go run and go install.
- sevensor 9y ago> It isn't a really significant benchmark though, for any language Sure, but it's reassuring to know that the universe is still sane, C is still faster than Javascript. Thanks for expanding on your comment!
- jrimbault 9y agoFound the old sources, reran the benchmark for 100 times each. c 0.062s f90 0.080s go 0.108s awk 0.116s lua 0.117s rs 0.140s sh 0.434s php 0.886s scm 1.323s py 2.965s rb 3.738s js 5.411s My memory was bad, I also added fortran for the occasion.
- sevensor 9y agoThanks for digging those up!
- simon83 9y agoPretty sure none of your implementations will beat the FizzBuzzEnterpriseEdition [1]. [1]: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- jrimbault 9y agoThat link is always marked as already visited and yet I always forget it exists.
- midwestcode 9y agothis is hilarious on so many levels...