Skip to content

sorting improvement #4045

@jfcg

Description

@jfcg

Experience Report

My experience with Go standard library's sort is that it is not a concurrent implementation (does not utilize multiple goroutines). This bid me once before when I tried to sort a very long array of ints. However I did not assess its affects on dgraph. Dgraph database also uses it extensively:

grep -Pr 'sort\.(?:IsSorted|Search|Float64s|Ints|Sort|Slice|Strings)' . | grep -c .

gives 252 results. I decided to open this issue to determine how it affects dgraph and how it can be improved.

Why that wasn't great, with examples

It took literally hours to sort the very long array I was interested in. Then I decided to implement my concurrent sorting implementation.

Any external references to support your case

Please see my concurrent implementation and benchmarks there. It is almost api-compatible with sort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/performancePerformance related issues.area/querylangIssues related to the query language specification and implementation.kind/enhancementSomething could be better.priority/P2Somehow important but would not block a release.status/acceptedWe accept to investigate/work on it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions