Hi,

I needed a concurrent sort for a huge integer list, wrote a simple one and 
found out about yours. Mine (sorty) does not:
- implement sort.Interface
- limit number of goroutines
- implement all common types, just uint64

Here is the go test output (sorting random 2^27 uint64s) on my laptop:

sort.Slice took 33.147487459s
sorty took 6.984276576s
sortutil took 13.109776227s
PASS
ok      sorty    64.500s

Here is the code: https://github.com/jfcg/sorty
Is the speed difference because of a lack of interface or unlimited number 
of goroutines? Do you think this is a good approach?

Thanks..

Note: to use it, assign to sorty.Ar and then call sorty.Sort() :P

On Sunday, May 3, 2015 at 11:37:52 PM UTC+3, Randall Farmer wrote:
>
> https://github.com/twotwotwo/sorts/ provides parallel radix- and 
> quicksorts for faster sorting of large datasets. (This is the stable 
> replacement for the radixsort.test package I posted some weeks back.)
>
> On the right sort of task, it can help a lot: sorting 11m English strings, 
> it saved 38% wall time on one core, 59% on two cores, and and 80% on eight 
> cores. On the stdlib's synthetic Benchmark1e6, ns/op was 71% lower on one 
> core and 80% lower on two. (Random-ish data like Benchmark1e6's is kind of 
> a best-case scenario for radix sort, so YMMV there.) More timings are at 
> https://docs.google.com/spreadsheets/d/1GkXMLXQ7oW5Bp0qwyYw0IiQElIq8B-IvNEYE_RPCTvA/edit
>  
> .
>
> The package has 100% test coverage (when tested with -cpu 2) and checks 
> its output is sorted after each run. There's no unsafe or cgo or asm. 
> Parallel/radix sorts aren't used on smaller collections where they don't 
> help. To limit or turn off concurrency in general, set sorts.MaxProcs. The 
> sorts/sortutil package has shortcuts for common slice types like stdlib 
> sort's (e.g., Ints(data []int)).
>
> Mostly, you should stick to stdlib sort, which is fast, standard, and 
> flexible, with a cleaner API. But I'm sure some folks out there have legit 
> use cases where package sorts's gains are worth the hassle, and this is for 
> them.
>
> Docs are at http://godoc.org/github.com/twotwotwo/sorts . E-mail me or 
> holler on Twitter (@rf) if you're using it, or just to say hey.
>
> Best,
> Randall
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to