4 ms·
Neither as fast nor out-of-core but, for fun, parallel sort of 2^30 floats (i5-6260U, two cores running at 2.7GHz): $ go run billion.go 1m32.471498831s
by twotwotwo 11y ago
Neither as fast nor out-of-core but, for fun, parallel sort of 2^30 floats (i5-6260U, two cores running at 2.7GHz):
$ go run billion.go
1m32.471498831s
Where billion.go goes:
package main
import (
"fmt"
"math/rand"
"time"
"github.com/twotwotwo/sorts/sortutil"
)
func main() {
floats := make([]float64, 1<<30)
for i := range floats {
floats[i] = rand.Float64()
}
t := time.Now()
sortutil.Float64s(floats)
fmt.Println(time.Now().Sub(t))
}
Out-of-core stuff's cool, and sometimes seems a shame it's not available directly (rather than by exporting data to some other program) and widely used in more programming environments.
Glad original poster's experimenting and got something about external sorting up here.
- ljw1001 11y agoThis is cool, I'm kinda fascinated by golang. Tablesaw's not out of core either: too much of a pain (for me) to work with variable width columns like text that way.