plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
234406e
— Peter John
2026-11-11T08:07:32+05:30
benchmarks: master options run against master e63393fb again
- benchmarks/master_vs_simpler/master/array.plum +0 -1
- benchmarks/master_vs_simpler/master/fib.plum +0 -1
- benchmarks/master_vs_simpler/master/loop.plum +0 -1
- benchmarks/master_vs_simpler/master/map.plum +0 -1
- benchmarks/master_vs_simpler/master/str.plum +0 -1
- benchmarks/master_vs_simpler/master/trig.plum +0 -1
- benchmarks/master_vs_simpler/run.py +4 -4
- benchmarks/scene_trees/run.py +12 -7
benchmarks/master_vs_simpler/master/array.plum
CHANGED
|
@@ -5,7 +5,6 @@ import std/Bool
|
|
|
5
5
|
import std/Option
|
|
6
6
|
import std/Io
|
|
7
7
|
import std/collections/List
|
|
8
|
-
import std/collections/LinkedList
|
|
9
8
|
import std/collections/Map
|
|
10
9
|
import std/math/math
|
|
11
10
|
|
benchmarks/master_vs_simpler/master/fib.plum
CHANGED
|
@@ -5,7 +5,6 @@ import std/Bool
|
|
|
5
5
|
import std/Option
|
|
6
6
|
import std/Io
|
|
7
7
|
import std/collections/List
|
|
8
|
-
import std/collections/LinkedList
|
|
9
8
|
import std/collections/Map
|
|
10
9
|
import std/math/math
|
|
11
10
|
|
benchmarks/master_vs_simpler/master/loop.plum
CHANGED
|
@@ -5,7 +5,6 @@ import std/Bool
|
|
|
5
5
|
import std/Option
|
|
6
6
|
import std/Io
|
|
7
7
|
import std/collections/List
|
|
8
|
-
import std/collections/LinkedList
|
|
9
8
|
import std/collections/Map
|
|
10
9
|
import std/math/math
|
|
11
10
|
|
benchmarks/master_vs_simpler/master/map.plum
CHANGED
|
@@ -5,7 +5,6 @@ import std/Bool
|
|
|
5
5
|
import std/Option
|
|
6
6
|
import std/Io
|
|
7
7
|
import std/collections/List
|
|
8
|
-
import std/collections/LinkedList
|
|
9
8
|
import std/collections/Map
|
|
10
9
|
import std/math/math
|
|
11
10
|
|
benchmarks/master_vs_simpler/master/str.plum
CHANGED
|
@@ -5,7 +5,6 @@ import std/Bool
|
|
|
5
5
|
import std/Option
|
|
6
6
|
import std/Io
|
|
7
7
|
import std/collections/List
|
|
8
|
-
import std/collections/LinkedList
|
|
9
8
|
import std/collections/Map
|
|
10
9
|
import std/math/math
|
|
11
10
|
|
benchmarks/master_vs_simpler/master/trig.plum
CHANGED
|
@@ -5,7 +5,6 @@ import std/Bool
|
|
|
5
5
|
import std/Option
|
|
6
6
|
import std/Io
|
|
7
7
|
import std/collections/List
|
|
8
|
-
import std/collections/LinkedList
|
|
9
8
|
import std/collections/Map
|
|
10
9
|
import std/math/math
|
|
11
10
|
|
benchmarks/master_vs_simpler/run.py
CHANGED
|
@@ -109,7 +109,7 @@ fun main(io: Io)
|
|
|
109
109
|
g := OrbitRunner.headless(seed)
|
|
110
110
|
wasOver := false
|
|
111
111
|
for t := range TICKS
|
|
112
|
-
g.update(io, inputAt(seed, t, g.world.run.over), 1.0 / 60.0)
|
|
112
|
+
g.game.update(io, inputAt(seed, t, g.world.run.over), 1.0 / 60.0)
|
|
113
113
|
r := g.world.run
|
|
114
114
|
if r.over && !wasOver
|
|
115
115
|
overs = overs + 1
|
|
@@ -198,7 +198,7 @@ fun main(io: Io)
|
|
|
198
198
|
events := List[InputEvent]()
|
|
199
199
|
events.push(PointerDown(x: Float({t * 97} % 800), y: Float({t * 61} % 600)))
|
|
200
200
|
inp := Input(held: Held.none(), events: events, pos: Vec2(x: 0.0, y: 0.0), wheel: 0.0)
|
|
201
|
-
g.update(io, inp.sized(800.0, 600.0), 1.0 / 60.0)
|
|
201
|
+
g.game.update(io, inp.sized(800.0, 600.0), 1.0 / 60.0)
|
|
202
202
|
check = {check * 31 + g.field.run.pops} % 1000000007
|
|
203
203
|
pops = pops + g.field.run.pops
|
|
204
204
|
t1 := io.nowMicros()
|
|
@@ -234,9 +234,9 @@ def write_games(master, out, orb_ticks, bp_ticks, only):
|
|
|
234
234
|
"""Writes the game drivers into `out` (master's only when `master` is given; only those
|
|
235
235
|
in `only` when it is given) and returns their (name, master, branch) paths."""
|
|
236
236
|
games = [
|
|
237
|
-
("orb_run", "/examples/games/orbitrunner/OrbitRunner.plum", "fun main(io: Io) ->
|
|
237
|
+
("orb_run", "/examples/games/orbitrunner/OrbitRunner.plum", "fun main(io: Io) -> Game",
|
|
238
238
|
ORB_MASTER, "examples/games/orb_run.plum", "fun main(io: Io) -> Game<State, Msg>", ORB_BRANCH, orb_ticks, ORB_SEEDS),
|
|
239
|
-
("balloon_pop", "/examples/games/balloonpop/BalloonPop.plum", "fun main(io: Io) ->
|
|
239
|
+
("balloon_pop", "/examples/games/balloonpop/BalloonPop.plum", "fun main(io: Io) -> Game",
|
|
240
240
|
BP_MASTER, "examples/games/kids/balloon_pop.plum", "fun main(io: Io) -> Game<State, Msg>", BP_BRANCH, bp_ticks, BP_SEEDS),
|
|
241
241
|
]
|
|
242
242
|
progs = []
|
benchmarks/scene_trees/run.py
CHANGED
|
@@ -81,12 +81,16 @@ def main():
|
|
|
81
81
|
if args.master:
|
|
82
82
|
master = os.path.abspath(args.master)
|
|
83
83
|
mplum = os.path.abspath(args.master_plum) if args.master_plum else os.path.join(master, "target/debug/plum")
|
|
84
|
+
srcs = {v: os.path.join(master, "benchmarks/scene_trees", v + ".plum") for v in ("game", "game_tree")}
|
|
84
|
-
|
|
85
|
+
srcs["enum_tree"] = os.path.join(HERE, "master/game_enum_tree_kept.plum")
|
|
86
|
+
for v in MASTER:
|
|
87
|
+
# A master program that is gone or no longer builds there is left out, and said so.
|
|
85
88
|
exes[v] = os.path.join(out, "m_" + v)
|
|
86
|
-
build(mplum, os.path.join(master, "benchmarks/scene_trees", v + ".plum"), exes[v], [], master)
|
|
87
|
-
|
|
89
|
+
try:
|
|
88
|
-
|
|
90
|
+
build(mplum, srcs[v], exes[v], [], master, master if v == "enum_tree" else None)
|
|
89
|
-
|
|
91
|
+
masters.append(v)
|
|
92
|
+
except subprocess.CalledProcessError:
|
|
93
|
+
print(f"master {v}: {srcs[v]} does not build on master, left out", file=sys.stderr)
|
|
90
94
|
for name, flags in BRANCH:
|
|
91
95
|
exes[name] = os.path.join(out, "b" + "".join(flags).replace("-", "_"))
|
|
92
96
|
build(plum, os.path.join(HERE, "scene_tree.plum"), exes[name], flags, ".")
|
|
@@ -107,7 +111,8 @@ def main():
|
|
|
107
111
|
times.setdefault((w, n, v), []).append(float(m.group(3)))
|
|
108
112
|
sums.setdefault((w, n), set()).add(m.group(4))
|
|
109
113
|
print(f"round {r + 1}: {WORKLOADS[w]} N={n} done", file=sys.stderr)
|
|
114
|
+
base = "enum_tree" if "enum_tree" in masters else (masters[0] if masters else None)
|
|
110
|
-
ratio = " branch /
|
|
115
|
+
ratio = f" branch / {base} |" if masters else ""
|
|
111
116
|
print("| workload | N | " + " | ".join(versions) + " |" + ratio + " checksum |")
|
|
112
117
|
print("|---|---|" + "---|" * (len(versions) + (2 if masters else 1)))
|
|
113
118
|
for w, n in cells:
|
|
@@ -119,7 +124,7 @@ def main():
|
|
|
119
124
|
continue
|
|
120
125
|
row += f" {fmt(statistics.median(ts))} ({fmt(min(ts))}-{fmt(max(ts))}) |"
|
|
121
126
|
if masters:
|
|
122
|
-
e = statistics.median(times[(w, n,
|
|
127
|
+
e = statistics.median(times[(w, n, base)]) if (w, n, base) in times else 0
|
|
123
128
|
b = statistics.median(times[(w, n, "branch")])
|
|
124
129
|
row += f" {b / e:.2f}x |" if e > 0 else " - |"
|
|
125
130
|
row += f" {', '.join(sorted(sums[(w, n)]))} |"
|