Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why comparing with quicksort? #8

Closed
andrewmed opened this issue Dec 25, 2018 · 1 comment
Closed

why comparing with quicksort? #8

andrewmed opened this issue Dec 25, 2018 · 1 comment

Comments

@andrewmed
Copy link

It seems that the benchmark is comparing with GO's implementation of quicksort (which is standard in go)

sort.Sort(&v)

Given that timsort is a stable sort, would not it be right to compare with sort.Stable() instead?

I got much worse results with that:

RevSorted100: 1500          (7806)        1582          (7759)        1469          (7773)        
Xor100:       4838          (5802)        4828          (5845)        4819          (5834)        
Random100:    5244          (7891)        5250          (7887)        5242          (7911)        

Sorted1K:     5597          (4837)        5584          (4838)        5633          (4846)        
RevSorted1K:  6588          (87094)       6523          (85785)       6562          (88508)       
Xor1K:        45714         (114406)      45331         (113812)      46041         (114143)      
Random1K:     114125        (202941)      132139        (203927)      114355        (202147)      

Sorted1M:     4129627       (8783352)     4129406       (8771254)     4148070       (8678536)     
RevSorted1M:  6239082       (114131971)   6189573       (115857436)   6199218       (114664717)   
Xor1M:        99852677      (224848697)   98523482      (228193397)   100662027     (222984886)   
Random1M:     362650134     (665379425)   348801121     (669130321)   340476927     (670888160)```
@psilva261
Copy link
Owner

That's true! Do you want to make a pull request? Otherwise I'll make one when I find the time, probably also adding that in the README.

(One time in the future I might add a GNU plot to this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants