Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
DeathArrow
on Dec 2, 2021
|
parent
|
context
|
favorite
| on:
The Fastest FizzBuzz Implementation
The most interesting thing is the C version is almost as fast as assembler version.
bonzini
on Dec 2, 2021
[–]
The most interesting thing is that it took one day to write the C version and several months for the assembly version, because the C version uses a simpler algorithm. Talk about diminishing returns. :)
pokepim
on Dec 2, 2021
|
parent
[–]
And you could copy paste Python version from SO and have it running in less than a minute, so here’s the winner :)
bonzini
on Dec 2, 2021
|
root
|
parent
|
next
[–]
If the Python version is 2000 times slower, the breakeven would be after a few terabytes of FizzBuzz.
Qem
on Dec 2, 2021
|
root
|
parent
|
next
[–]
The Python version posted is about 85 MiB/sec, so only 600 times slower than the fastest one.
bonzini
on Dec 2, 2021
|
root
|
parent
|
next
[–]
Ah, forgot about pypy!
DeathArrow
on Dec 3, 2021
|
root
|
parent
|
prev
[–]
Yes, but if you start the Python version and still have 5 minutes left from the day, the C version will overtake Python.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: