bellbind/stepbystep-timsort

License

Opened this issue · 2 comments

Hey @bellbind, thanks for putting up this tutorial.

We're thinking of using some of the Timsort implementation as the basis of a self-hosted Array.sort for SpiderMonkey, the JS engine of Firefox.

Unfortunately, we can't use the code if it isn't available under a license that's compatible with the MPL2.

Would you be willing to put the code under either the MPL2, 3-clause BSD, MIT or donate it to the Public Domain? Obviously, you'd have to have the right to do that, so none of the code could be taken from another source with an incompatible license.

thanks,
till

I published the repository almost as an article of the algorithm explanation.
so I will be the codes to Public Domain.


At first I knew the architecture of timsort (python's sort) from the article: http://www.drmaciver.com/tag/timsort/

But the code of the article is complex for understanding detail mechanisms because of all-in-one the features.

So I started from the naive recursive merge sort (and binary sort).
I improved to two ways ( split side, and merge side) improvement independently.
At last merged the two ways in one.

Every steps of improvements of javascript are my original codes.
I think the "galloping" part is very different style from original one.

(Java version is directly converted from js code for benchmarking).

Great! Thanks for the quick reply and thorough explanation.

We'll continue experimenting with the code, then. No rush on adding a license header: we won't be in a position to actually release the code for some time, I guess.