Update benchmarks.

This commit is contained in:
KtorZ
2024-08-30 15:45:00 +02:00
parent a06383d333
commit e3e889f875
12 changed files with 78 additions and 64 deletions

View File

@@ -41,6 +41,23 @@ queens5x5/fc 1867 179227518621 1023295666
-->
<!--
v1.1.0
┍━ benchmarks/clausify/benchmark ━━━━━━━━━━━━━━━━━━━━━━━━━━━
│ PASS [mem: 53769377, cpu: 16198154564] bench_clausify_f1
│ PASS [mem: 67108683, cpu: 20169891270] bench_clausify_f2
│ PASS [mem: 179606857, cpu: 53923018831] bench_clausify_f3
│ PASS [mem: 231444137, cpu: 70014384566] bench_clausify_f4
│ PASS [mem: 874286879, cpu: 262421671684] bench_clausify_f5
┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5 tests | 5 passed | 0 failed
┍━ benchmarks/knights/benchmark ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
│ PASS [mem: 172246681, cpu: 57037226471] bench_knights_100_4x4
│ PASS [mem: 321690197, cpu: 137399466410] bench_knights_100_6x6
│ PASS [mem: 601026745, cpu: 281418742606] bench_knights_100_8x8
┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3 tests | 3 passed | 0 failed
v1.0.29-alpha & v1.0.28-alpha
┍━ benchmarks/clausify/benchmark ━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -128,26 +145,26 @@ V1.0.20-alpha, v1.0.19-alpha & v1.0.18-alpha
### CPU
| Benchmark | `v1.0.29` | vs `v1.0.25` | vs `v1.0.23` | vs `v1.0.21` | vs `v1.0.18` |
| Benchmark | `v1.1.0` | vs `v1.0.29` | vs `v1.0.25` | vs `v1.0.23` | vs `v1.0.21` |
| --- | ---: | ---: | ---: | ---: | ---: |
| `clausify_f1` | 21594809455 | -6.26% | +11.71% | +11.71% | +11.84% |
| `clausify_f2` | 26864755594 | -6.07% | +11.30% | +11.30% | +11.44% |
| `clausify_f3` | 71814854199 | -5.98% | +11.17% | +11.17% | +11.31% |
| `clausify_f4` | 93024749730 | -5.01% | +9.37% | +9.37% | +9.55% |
| `clausify_f5` | 349894049008 | -6.00% | +11.24% | +11.24% | +11.35% |
| `knights_100_4x4` | 71851995726 | +1.40% | +4.45% | +4.30% | +4.80% |
| `knights_100_6x6` | 159767368294 | +8.93% | +11.92% | +11.85% | +12.70% |
| `knights_100_8x8` | 319834775948 | +11.40% | +14.35% | +14.32% | +15.13% |
| `clausify_f1` | 16198154564 | -24.99% | -6.26% | +11.71% | +11.71% |
| `clausify_f2` | 20169891270 | -24.92% | -6.07% | +11.30% | +11.30% |
| `clausify_f3` | 53923018831 | -24.91% | -5.98% | +11.17% | +11.17% |
| `clausify_f4` | 70014384566 | -24.74% | -5.01% | +9.37% | +9.37% |
| `clausify_f5` | 262421671684 | -25.00% | -6.00% | +11.24% | +11.24% |
| `knights_100_4x4` | 57037226471 | -20.62% | +1.40% | +4.45% | +4.30% |
| `knights_100_6x6` | 137399466410 | -14.00% | +8.93% | +11.92% | +11.85% |
| `knights_100_8x8` | 281418742606 | -12.00% | +11.40% | +14.35% | +14.32% |
### Mem
| Benchmark | `v1.0.29` | vs `v1.0.25` | vs `v1.0.23` | vs `v1.0.21` | vs `v1.0.18` |
| Benchmark | `v1.1.0` | vs `v1.0.29` | vs `v1.0.25` | vs `v1.0.23` | vs `v1.0.21` |
| --- | ---: | ---: | ---: | ---: | ---: |
| `clausify_f1` | 53769377 | -2.29% | +20.40% | +20.40% | +20.63% |
| `clausify_f2` | 67108683 | -2.54% | +19.63% | +19.63% | +19.87% |
| `clausify_f3` | 179606857 | -2.64% | +19.38% | +19.38% | +19.61% |
| `clausify_f4` | 231444137 | -2.75% | +16.33% | +16.33% | +16.64% |
| `clausify_f5` | 874286879 | -2.63% | +19.53% | +19.53% | +19.72% |
| `knights_100_4x4` | 172256715 | -0.48% | +5.04% | +4.90% | +5.80% |
| `knights_100_6x6` | 321712271 | +10.08% | +16.54% | +16.46% | +18.29% |
| `knights_100_8x8` | 601065675 | +14.48% | +21.30% | +21.26% | +23.15% |
| `clausify_f1` | 53769377 | ± 0.00% | -2.29% | +20.40% | +20.40% |
| `clausify_f2` | 67108683 | ± 0.00% | -2.54% | +19.63% | +19.63% |
| `clausify_f3` | 179606857 | ± 0.00% | -2.64% | +19.38% | +19.38% |
| `clausify_f4` | 231444137 | ± 0.00% | -2.75% | +16.33% | +16.33% |
| `clausify_f5` | 874286879 | ± 0.00% | -2.63% | +19.53% | +19.53% |
| `knights_100_4x4` | 172246681 | -0.01% | -0.48% | +5.04% | +4.90% |
| `knights_100_6x6` | 321690197 | -0.01% | +10.08% | +16.54% | +16.46% |
| `knights_100_8x8` | 601026745 | -0.01% | +14.48% | +21.30% | +21.26% |

View File

@@ -3,13 +3,14 @@
[[requirements]]
name = "aiken-lang/stdlib"
version = "1.9.0"
version = "main"
source = "github"
[[packages]]
name = "aiken-lang/stdlib"
version = "1.9.0"
version = "main"
requirements = []
source = "github"
[etags]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1725022066, nanos_since_epoch = 34627000 }, "21da5761ffd088c964cb038888826da8a6ea1d8c26f6f4e8a1dc6e97a64fe3f7"]

View File

@@ -1,5 +1,5 @@
use aiken/int
use aiken/list
use aiken/collection/list
use aiken/primitive/int
// ------------------------------------------------------------------ Benchmarks

View File

@@ -1,4 +1,4 @@
use aiken/list
use aiken/collection/list
use benchmarks/knights/heuristic.{descendants, start_tour, tour_finished}
use benchmarks/knights/queue.{Queue}
use benchmarks/knights/types.{ChessSet, Solution}
@@ -10,11 +10,11 @@ test bench_knights_100_4x4() {
}
test bench_knights_100_6x6() {
run_knights(100, 6) == solution_100_6x6()
run_knights(100, 6) == solution_100_6x6
}
test bench_knights_100_8x8() {
run_knights(100, 8) == solution_100_8x8()
run_knights(100, 8) == solution_100_8x8
}
// ----------------------------------------------------------------------- Setup
@@ -30,7 +30,7 @@ fn depth_search(
done: fn(a) -> Bool,
) -> Queue<a> {
if depth == 0 || queue.is_empty(xs) {
queue.new()
queue.empty
} else if done(queue.head(xs)) {
depth_search(depth - 1, queue.remove_front(xs), grow, done)
|> queue.append_front(queue.head(xs))
@@ -41,7 +41,7 @@ fn depth_search(
}
fn root(size: Int) -> Queue<(Int, ChessSet)> {
queue.append_all_front(queue.new(), mk_starts(size))
queue.append_all_front(queue.empty, mk_starts(size))
}
fn mk_starts(size: Int) -> List<(Int, ChessSet)> {
@@ -79,7 +79,7 @@ fn done(item: (Int, ChessSet)) -> Bool {
// ------------------------------------------------------------------ Fixtures
fn solution_100_6x6() -> Solution {
const solution_100_6x6: Solution =
[
(
0,
@@ -266,9 +266,9 @@ fn solution_100_6x6() -> Solution {
},
),
]
}
fn solution_100_8x8() -> Solution {
const solution_100_8x8: Solution =
[
(
0,
@@ -493,4 +493,3 @@ fn solution_100_8x8() -> Solution {
},
),
]
}

View File

@@ -1,4 +1,4 @@
use aiken/list
use aiken/collection/list
use benchmarks/knights/types.{ChessSet, Tile}
pub fn create_board(size: Int, init_square: Tile) -> ChessSet {

View File

@@ -1,6 +1,6 @@
use aiken/builtin
use aiken/int
use aiken/list
use aiken/collection/list
use aiken/primitive/int
use benchmarks/knights/chess_set.{
add_piece, create_board, delete_first, first_piece, is_square_free, last_piece,
}
@@ -18,9 +18,8 @@ type Direction {
RD
}
fn direction_list() {
const direction_list =
[UL, UR, DL, DR, LU, LD, RU, RD]
}
fn move(direction: Direction, tile: Tile) -> Tile {
let (x, y) = tile
@@ -130,7 +129,7 @@ fn move_knight(board: ChessSet, direction: Direction) -> ChessSet {
}
fn possible_moves(board: ChessSet) -> List<Direction> {
direction_list() |> list.filter(can_move(board, _))
direction_list |> list.filter(can_move(board, _))
}
fn compare_chess_set(a: (Int, ChessSet), b: (Int, ChessSet)) -> Ordering {

View File

@@ -1,12 +1,10 @@
use aiken/list
use aiken/collection/list
pub opaque type Queue<a> {
inner: List<a>,
}
pub fn new() -> Queue<a> {
[] |> Queue
}
pub const empty: Queue<a> = [] |> Queue
pub fn to_list(self: Queue<a>) -> List<a> {
self.inner

View File

@@ -1,4 +1,4 @@
use aiken/list
use aiken/collection/list
pub fn quicksort(xs: List<a>, compare: fn(a, a) -> Ordering) -> List<a> {
when xs is {