import sequtils
proc quickSort(arr: seq[int]): seq[int] =
if arr.len == 0: return @[]
let pivot = arr[0]
let smaller = arr[1..^1].filterIt(it <= pivot)
let bigger = arr.filterIt(it > pivot)
concat(smaller.quickSort, @[pivot], bigger.quickSort)
Previous Posts
- Light WASM Baseline
- Building Bounding Volume Hierarchies With Octrees
- Bounding Volume Hierarchies
- Raybench - Gleam
- Bringing Back The Triangles
- Multi-threading SharedArrayBuffer And Atomics
- WebAssembly & SIMD
- Use WebAssembly to Speedup DOD
- Very Slow Data-Oriented Design
- Speeding Things Up
View All Posts