pobrn / mktorrent

A simple command line utility to create BitTorrent metainfo files
Other
472 stars 73 forks source link

implement quicksort for faster file path sorting #33

Closed aheadley closed 4 years ago

aheadley commented 5 years ago

I am creating a torrent with around 2 million files and the insertion sort in init() absolutely murders performance, just walking the files took almost 24 hours. I changed it to just prepend each file and sort at the end with quicksort and walking the files now takes about 5 minutes.

Rudde commented 4 years ago

Great addition. However, quicksort is unstable (in terms of sorting algorithms) algorithm, this should be optional and not a replacement.

Rudde commented 4 years ago

Solved in pull request #42 with a stable algorithm.