0x7CFE / llst

LLVM powered Little Smalltalk.
Other
93 stars 10 forks source link

Sort is broken #35

Closed 0x7CFE closed 11 years ago

0x7CFE commented 11 years ago

Random sized lists are returned. However this is not a correct behaviour for the benchmark:

benchmark: size | list ms |
    list <- List new.
    1 to: size do: [ :x | list add: 1000 atRandom ].
    ms <- Timer millisecondsToRun: [ list <- list sort. ].
    "list do: [ :e | e printNl ]."
    'Sorted in ms: ' print. ms printNl.
    list printNl.
->nil benchmark: 1000
Sorted in ms: 52
List (224 226 229 231 576 577 885 886 961 962 971 972 972 973 975 976 977 977 978 980 ...)
nil
->nil benchmark: 1000
Sorted in ms: 58
List (985 986 986 986 986 987 987 991 992 992 992 995 997 997 998 999)
nil
->nil benchmark: 1000
Sorted in ms: 48
List (353 354 805 807 884 885 988 990 992 993 996 1000 1000 1000)
nil
->nil benchmark: 1000
Sorted in ms: 48
List (480 482 646 647 966 969 996 998 998 998 999)
nil
->nil benchmark: 1000
Sorted in ms: 48
List (633 634 766 767 777 780 932 933 951 954 999 1000 1000)
nil
->nil benchmark: 1000
Sorted in ms: 47
List (601 602 862 863 970 972 972 972 973 973 976 981 983 985 985 986 986 987 987 988 ...)
nil
->nil benchmark: 1000
Sorted in ms: 53
List (31 34 862 863 871 872 932 933 961 965 994 995 995 996 996 997 999)
nil
kpp commented 11 years ago
->nil benchmark: 0
Sorted in ms: 0
List ()
nil
->nil benchmark: 2
Sorted in ms: 0
List (47 440)
nil
->nil benchmark: 2
Sorted in ms: 0
List (117 878)
nil
->nil benchmark: 2
Sorted in ms: 0
List (44 451)
nil
->nil benchmark: 400
Sorted in ms: 20
List (3 11 11 12 15 20 23 30 34 34 36 40 42 43 43 45 46 49 51 51 ...)
nil
->nil benchmark: 400
Sorted in ms: 22
List (3 6 9 10 11 14 15 17 17 18 18 19 23 24 27 27 29 30 30 36 ...)
nil
->nil benchmark: 400
Sorted in ms: 20
List (8 10 10 12 13 13 14 17 17 21 26 28 28 29 34 35 35 37 41 41 ...)
nil