Re:A Million Digits of Pi in 9 Lines of JavaScript
by sp332 on Thursday September 12, 2019 @03:54PM
(#20955696)
This also takes a lot of RAM. Keep an eye on it during longer executions or the swapping could make your box pretty unusable.
[ Parent
| on HN ]
Re:A Million Digits of Pi in 9 Lines of JavaScript
by at-fates-hands on Thursday September 12, 2019 @05:36PM
(#20956724)
I used to have a script on my personal site that would just continue to compute digits of Pi until your browser crashed. I finally took it down after too many recruiters and potential employers keep clicking on the link that said, "Don't Click This." and complaining about it.
I did the same thing when I was testing it. I would keep an eye on the system RAM resources graph as the script was running. Watching the RAM start to spike was oddly satisfying.
It's pretty scary to me how easy it is to crash a browser these days with something so simple.
Re:A Million Digits of Pi in 9 Lines of JavaScript
by ajennings on Thursday September 12, 2019 @05:14PM
(#20956532)
It should take 415kB to store a million digit number, and the algorithm only needs to keep two of them. So, 1MB total to calculate a million digits of pi. I wonder if there are a lot of temporary allocations that build up until they get garbage collected.