Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Accidentally Quadratic Node.js left-pad (accidentallyquadratic.tumblr.com)
11 points by colinprince on April 8, 2016 | hide | past | favorite | 1 comment


A second, steeper, linear trend indicates to me that there is another O(n) operation that is presumably amortised (or cached) for smaller values of n. I'm not familiar with the string implementations in either V8 or Chrome, nor their memory allocator implementations, but id assume that's where someone should look to find that second linear trend.

A quick tip to the author for when you plot regression lines: always include the R^2 value. I'm not entirely convinced the entire trend in the second graph is "linear".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: