Commit Graph

3 Commits

Author SHA1 Message Date
Bob Nystrom
f3c68323bd fix: increase test timeout from 2 to 5 seconds and add skynet fiber benchmark example
The test runner's per-test timeout was raised to 5 seconds to prevent flaky
timeouts on slower systems. A new example file (example/skynet.wren) was added
demonstrating a million-fiber microbenchmark based on the skynet algorithm,
showcasing Wren's fiber concurrency model. Additionally, the shuffle test's
tolerance threshold was relaxed from 0.2 to 0.21 to reduce false positives
in the random distribution check.
2016-02-15 06:21:50 +00:00
Bob Nystrom
19d7215412 feat: add sample(list) and sample(list, count) methods to Random class with two sampling algorithms 2016-02-09 15:24:45 +00:00
Bob Nystrom
813594b14c feat: add Random.shuffle() method using Fisher-Yates algorithm
Implement in-place shuffle for lists on the Random class, using the Fisher-Yates algorithm to ensure uniform permutation distribution. Includes documentation with usage examples, Wren source implementation, and a test suite covering empty lists, single-element lists, and verification that all 24 permutations of a 4-element list are reachable.
2016-02-07 18:38:39 +00:00