1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-25 22:53:16 +00:00
janet/src/boot
Felix Riedel 3e742ffc4c Improve quicksort to avoid worst case performance.
The current implementation will have quadratic behaviour for already
sorted arrays because it picks the last element as pivot. In an sorted
array this splits the array repeatedly into the biggest value and all
other values.

The implementation in this commit uses the *median of three* as pivot.

`janet -e "(sort (range 10000))"` to reproduce quadratic behaviour.
2020-12-26 19:18:17 +00:00
..
array_test.c Update Copyright 2020. 2020-01-12 10:50:37 -06:00
boot.c Remove REPL-within-form thread-local bool 2020-05-21 18:31:21 +01:00
boot.janet Improve quicksort to avoid worst case performance. 2020-12-26 19:18:17 +00:00
buffer_test.c Update Copyright 2020. 2020-01-12 10:50:37 -06:00
number_test.c Update Copyright 2020. 2020-01-12 10:50:37 -06:00
system_test.c Fix NaNboxing bug that cause flaky builds. 2020-09-06 14:59:29 -05:00
table_test.c Add tests to check janet_table_remove behaviour 2020-07-02 11:03:08 -03:00
tests.h Begin work on new memory layout for all objects and GC. 2019-02-21 11:22:29 -05:00