Trying to figure out a bizarre performance drop in a merge sort I wrote for one of those daily coding problems. https://bruceediger.com/posts/mergesort-investigation-1/ It seems that adding one node to a linked list causes a repeatable performance drop. That is, linked lists of say 2^21 nodes sort faster than lists of 2^21 + 1 nodes.
Does it have to do with when garbage collection is triggered?
A C-transliteration of my original Go algorithm shows similar overall performance, with performance drops at the same list lengths.
Forcing garbage collection right after each sort (releasing all references to the sorted linked list) didn't change anything, either: https://bruceediger.com/posts/mergesort-investigation-10/