Log inGet started
World

Kit Speed Lab: Repeatable Benchmarks for Kits and Games

README.md

speedLabHoldTheLine

Version 0.1.12. Names towerDefenseKit 1.2.45 (released through Hold the Line PR #16, with wavePreviewKit 1.1.12 and creepsKit 1.3.14). Round 16f rows compare spawnerKit 1.2.12 and 1.2.13 path placement inside Hold the Line, desktop and browser twice each (about -99.5% a call, -97% of the placement time a second in the held worst wave), with the round 15 desktop rows kept. Round 16b rows compare creepsKit 1.3.12 and 1.3.13 (one creep tick loop in every run, no speed difference claimed). Round 14 rows measured on towerDefenseKit 1.2.41 -> 1.2.42 (Hold the Line 9c686284 -> 1570ae8e), browser host and desktop; earlier rows measured on towerDefenseKit 1.2.33 to 1.2.35 (Hold the Line main, spawnerKit 1.2.11; round 10 browser-host runs on the 1.2.35 code, ae15a274) against Hold the Line a4a4b0c4 (towerDefenseKit 1.2.28). The Kit Speed Lab's benchmark set for Hold the Line, the ten-wave tower defense map built with towerDefenseKit: turretsKit's six towers with three tiers, spawnerKit's waves, creepsKit's eleven enemy types (brutes, shieldbearers, fliers, healers, splitters, sneaks and the Warlord), a MatchFlow match with build breaks (kit and game world 37a76806-2009-4346-8a3a-e0c90581eb7b).

It measures what a tower defense costs: the quiet map before the first game with no towers and no enemies, normal play on wave 5 with six towers ("why is my tower defense slow"), The Horde (wave 9) against twelve tier-2 towers from the game camera and low over the road, the worst case of wave 10 with the Warlord and eighteen tier-3 towers firing ("tower defense lag late waves", "many enemies lag"), three fixed views, a camera fly-through, two players, and a five-minute soak of normal play with memory sampled, which shows whether memory stays flat. Each runs on desktop settings and at tablet settings.

Everything is built through the kits' public API: towerDefenseKit's net.request (restart, build, upgrade), match (MatchFlow's callWave, setHold, reset), layouts, paths, grid and waves; spawnerKit's spawner, alive, despawn and spawn; SecondWind's kill; economyKit's credit for the team's gold. The set runs in any scene that holds a towerDefenseKit game, such as Hold the Line's forest map, and aims its cameras from that game's map and camera.

  • speedLabHoldTheLine.set: the benchmark definitions, registered with Lab.register (id holdTheLine).
  • speedLabHoldTheLine.results: Hold the Line's before and after numbers, desktop and browser (empty until measured).
  • Guide: How to measure how fast a tower defense game runs.
  • Example guide: Example: speeding up Hold the Line's last wave with the speed lab, start to finish.

Run the whole set from the lab's board, or in play: zero speedLab run speedLabHoldTheLine.set (quiet, play, stress, worst, still, fly, 2p, soak, tablet pick a part).

A wave benchmark plays the real game up to its wave on the deciding machine: it restarts the game, plays every earlier wave at eight times speed (each enemy killed through SecondWind, so the match counts every wave cleared), builds the towers on the same best cells every run, calls the wave and holds it: once the wave's own spawns have walked in, more of its kinds keep the field at the wave's size, the Warlord stays on the road in wave 10, enemies at the goal leave as "cleared" and the lives stay full. The towers shoot and kill as in play. Teardown starts a fresh game.

Version history

0.1.12

Names towerDefenseKit 1.2.45 instead of 1.2.44. 1.2.44, wavePreviewKit 1.1.11 and creepsKit 1.3.13 were published by a commit straight to Hold the Line's main, without a pull request; 1.2.45, wavePreviewKit 1.1.12 and creepsKit 1.3.14 carry the same content through Hold the Line PR #16 (merge commit 3969dcb7, Hold the Line on @builtin 9ebd3eb). The lab installs all three. No change to the kits' code, so the measured rows stand.

0.1.11

Names towerDefenseKit 1.2.44 (reviewed; the lab now installs it, with wavePreviewKit 1.1.11 and creepsKit 1.3.13) instead of 1.2.35.

0.1.10

Round 16f rows (htlbrowser): spawnerKit 1.2.12 against 1.2.13 path placement inside Hold the Line, desktop and browser twice each, like-for-like: both released placement modules loaded from scratch files in one session on the game's own road (per call 5.9 / 7.4 -> 0.035 / 0.033 ms desktop, 8.6 / 8.4 -> 0.044 / 0.042 ms browser) and inside the held worst wave with every real spawn replayed on both (27.2 / 23.5 -> 0.66 / 0.71 ms a second desktop, 22.9 / 18.4 -> 0.79 / 0.58 browser). The round 15 desktop rows are now in this set too. Notes: the browser engine held the 1.2.12 files under Hold the Line's 1.2.13 install record (platform bug filed). Script and raw results: Hold the Line speedround16f/.

0.1.9

Round 16b rows (speed16): creepsKit 1.3.12 against 1.3.13 in Hold the Line after repeated play/edit flips, desktop and browser twice each; one creep tick loop in every run on both versions.

0.1.8

  • README only: the 0.1.7 note on the refused g:getRules() call now says the set reads the rules through the kit api. Benchmarks and rows as in 0.1.7.

0.1.7

  • Worst-wave benchmark: reads the wave table through towerDefenseKit.api.rules.resolve(rules, difficulty) instead of g:getRules(), which the current engine refuses (the kit's getRules is a component function, not a method on the game handle).

  • round 14 results: towerDefenseKit 1.2.41 (Hold the Line 9c686284, the previous published version) against 1.2.42 (main 1570ae8e, the release that installs into a fresh world again; no code change). Worst wave, twice each side: the browser as HOST (web client hosting the play room, alone, since no sub-client slot was free for a joiner) and desktop. Nothing moved beyond run-to-run noise, as expected with the same code: browser wall p50 33.1 / 34.2 -> 29.3 / 33.3 ms, Commander 0.12 / 0.14 -> 0.12 / 0.13 ms a frame; desktop wall p50 17.1 / 16.2 -> 16.6 / 16.4 ms. The after browser host draws no forest tree line (the round 10 open issue), so its GPU number is not like-for-like. Same-camera desktop pictures in Hold the Line media/speedround14; the browser picture could not leave the web client. (The run harness worked around the refused g:getRules() call; the set itself now reads the rules through the kit api, see above.)

0.1.6

  • round 10 results: the browser as HOST with a second player joined (a native client in the same play room), two before (before-r7, a4a4b0c4) and two after (branch after-r10, ae15a274, the towerDefenseKit 1.2.35 code) runs with the same drive and sampling as round 9 and the Commander and world clock rows with their file paths. World clock -56% (0.91 to 0.40 ms a frame); the Commander shows no gain as host (0.40 to 0.43 median); the whole frame was busier after (other agents' clients running) and is not claimed. Host and join checked with the multiplayer surface; the joiner sees wave 10. Same-camera pictures from the browser host; the after host draws no forest trees (open). The round 9 rows are kept.

0.1.5

  • round 9 results, like-for-like: the client running the match is alone in every run, two before (before-r7, a4a4b0c4) and two after (main) on desktop AND in the browser, with the Commander and world clock rows and their file paths: Commander -33% desktop and -85% browser, world clock -85% and -95%. A browser playing alone now finishes every wave (spawnerKit 1.2.11). The round 7 browser after rows with the web client as a joiner are marked not like-for-like. Same-camera pictures (forest materials load in both; the pale look is fog) and the round 6 fog pictures retaken. Notes say why the set's getRules call needs a fallback on today's engine. The set's dependency names towerDefenseKit 1.2.35.

0.1.4

  • round 7 results: worst wave before (published towerDefenseKit 1.2.28) and after (published 1.2.30, Cloudburst 1.6.8), two desktop runs each, with the Commander and world clock rows from the Luau sampler: the Commander about half (14.0 / 15.5 -> 6.5 / 8.4 ms a second), the world clock row unchanged because Cloudburst draws nothing in Hold the Line (a worldClockKit load-order problem, filed). Browser (added by helper pair7): two before runs with the web client deciding on branch before-r7, two after runs on published main with the web client joining a native host (a browser that decides never ends wave 1 on main: found, open), so no browser gain is claimed; profiler row paths named. Two players, native host plus browser, on main: the same wave, lives, gold, countdown and towers, played to the end with the playtest bot (lost on wave 10). The set's dependency names towerDefenseKit 1.2.31.

0.1.3

  • the first published results for Hold the Line: worst wave before and after on desktop (two and four runs), the world clock row before and after, with Cloudburst 1.6.7 swapped in locally, the other script rows, the two-player check and two full games played to an end. They say plainly that no gain reached the players this round and why, and that there are no browser numbers and why. Both guides name 0.1.3; the example guide points at the real numbers.

0.1.2

  • runs on towerDefenseKit 1.2.28 (built on the current controls kit, controlsKit 1.4.11). Same benchmarks, same names, same way to run them.

0.1.1

  • the guides, the set and the results are published as their own assets (0.1.0 recorded those folders without their own entry, so they arrived as loose files and library search did not list the guides).

0.1.0

  • First set: quiet, play, stress, worst (wave 10 with the Warlord and eighteen tier-3 towers), still, fly, 2p and a five-minute memory soak, each for desktop and tablet; plays the real game up to each wave; the how-to and example guides; results empty until measured.