338 karma · joined October 1, 2018
The last time Timsort was posted on HN was here [0] and here [1], and neither article seemed to have similar detail.
[0] https://news.ycombinator.com/item?id=27823180
[1] https://news.ycombinator.com/item?id=21196555 (the article for this link is now a 404)
sizes = [2**i for i in range(1, 29)]
The limits that matplotlib fills in are largely superficial, the benchmarks and the x axis are only being evaluated at powers of two.Your points about the other two graphs though is very good. I think my graphs could use some clarity. The main reason why I didn't use a log scale and compute on much much larger inputs is mainly because it would just take too long for my laptop to compute.
Also, if you want to, the repo provides a build script for the C-extension so you can mess around with the benchmarks. I would love for you to find some bugs in my implementation :).
for (step >>= 1; step != 0; step >>=1) {
if ((next = begin + step) < size) {
begin += PyObject_RichCompareBool(PyList_GetItem(list_obj, next), value, Py_LT) * step;
}
}EDIT: issue is fixed now I think
[0] https://probablydance.com/2023/04/27/beautiful-branchless-bi...
You can also do similar things for work related notifications (ie. I had github and slack apps automatically muted after 5pm). I find that the approach of letting the notifications pile up and then checking at my leisure let’s me slowly start to forget about my phone except when it serves an actual purpose.