mudlet/docs
Vadim Peretokin 9a9710b229
fix: new profiles process game text about twice as fast (#9705)
#### Brief overview of PR changes/additions

- The starter UI armed **77 always-active PCRE triggers** (12 chat + 65
vitals) at package load, so every line a game sent was matched against
all of them - and every line one matched was then re-walked in Lua with
all 77 patterns **recompiled from source**, because `rex.match` given a
pattern string compiles it afresh on every call. They are now fronted by
4 triggers (3 chat-routing groups + 1 vitals prefilter) and compiled
once. The 65 vitals shapes and 12 chat shapes are byte-identical and
still do all the reading.
- The plain-text vitals layer now retires itself once GMCP or MSDP holds
the source lock, since `applyVitals` discards its readings from that
point anyway, and re-arms on disconnect.
- `PipelineBenchmark` created its profile through the production
new-profile path, so the starter UI was **inside** the
`text_lines_per_sec` baseline backing the "no more than 10% throughput
loss" gate for #9011 - the guard built to catch this class of regression
could not see it. Pipeline metrics now come from a profile with default
packages suppressed; the shipped configuration is reported separately as
`defaults_*` and gated in its own right.

#### Motivation for adding to Mudlet

Every new 5.0 profile was paying roughly half its text throughput to a
default package, and the perf guard had the cost baked into its own
baseline so nothing flagged it.

#### Other info (issues closed, discussion etc)

Findings C17 and C18 of the 5.0 QA sweep. Bisected there to `69cd06b1c`
- "add: starter interface with health bars, map and chat for new
players" (#9454); the benchmark half is the interaction of that with
`7d67d4bfb` - "infrastructure: perf baseline" (#9509).

Measured on a quiet 16-core box, Release, no ASan, alternating paired
runs so drift is shared between arms:

| workload | before | after | |
| --- | --- | --- | --- |
| `TelnetBenchmark` `benchLargeData`, 1000 lines that match nothing |
22.25 ms `[22.1-22.6]` | 12.0 ms `[11.9-12.2]` | **1.85x** |
| `PipelineBenchmark`, 25k lines of realistic game output, new-user
profile | 9,998 lines/s `[9,856-10,072]` | 16,503 lines/s
`[16,257-16,632]` | **1.65x** |

Complete separation in both (21 and 9 pairs; within-arm spread ±1.7% and
±1.5%, so ~3% is the smallest effect distinguishable from noise - the
effect is 85% and 65%). The bare pipeline measures 116,000 lines/s, so
the starter UI's remaining cost on that corpus is 7.0x, down from 11.6x;
the residual is the capture layer doing its designed work on a corpus
where 1 line in 11 is a tell and another 1 in 11 a vitals prompt.

Two notes for reviewers:
- `config.lua` is bumped to 1.1.0, so mpkg offers the update - but
default packages are installed at profile creation, so **profiles
already created on a 5.0 PTB keep the old copy** until they update it.
- Touches `src/mudlet.cpp` / `src/mudlet.h` /
`test/functional_tests/CMakeLists.txt`, which #9695 also touches; the
CMakeLists hunk will likely conflict trivially (both append a test
file).

**Test case:** create a fresh profile against any game without GMCP,
confirm the health/mana gauges and chat tabs still appear from prompt
and chat lines, then `ctest -R StarterUiTriggerCostTest`.

Assisted-by: Claude:claude-opus-5
2026-08-08 09:04:14 +00:00
..
package-capture-audits add: starter interface with health bars, map and chat for new players (#9454) 2026-07-26 08:43:21 +02:00
AI-ASSISTANTS.md Infra: Move developer documentation to /docs (#8120) 2025-08-27 10:22:23 +02:00
ai-instructions.md infrastructure: slim down the AI assistant instructions (#9511) 2026-07-26 15:23:14 +02:00
CODE_OF_CONDUCT.md Infra: Move developer documentation to /docs (#8120) 2025-08-27 10:22:23 +02:00
CONTRIBUTING.md Infrastructure: update CONTRIBUTING.md with AI coding guidelines (#9224) 2026-04-29 06:57:35 +02:00
demo-videos.md infrastructure: document how to record before & after demo videos (#9482) 2026-07-22 09:29:30 +02:00
FUNDING.yml Infra: Move developer documentation to /docs (#8120) 2025-08-27 10:22:23 +02:00
GITHUB.md Infra: Move developer documentation to /docs (#8120) 2025-08-27 10:22:23 +02:00
libmudlet-perf-baseline.md fix: new profiles process game text about twice as fast (#9705) 2026-08-08 09:04:14 +00:00
libmudlet-widgets-report.md infrastructure: harden the Widgets audit script and refresh its baseline (#9516) 2026-07-26 18:05:59 +02:00
platform-builds.md infrastructure: slim down the AI assistant instructions (#9511) 2026-07-26 15:23:14 +02:00
README.md Infra: Move developer documentation to /docs (#8120) 2025-08-27 10:22:23 +02:00
SUPPORT.md Infra: Move developer documentation to /docs (#8120) 2025-08-27 10:22:23 +02:00

docs Directory

This directory contains documentation files intended for developers and contributors that help manage the Mudlet project's development workflow.

Files and Their Purpose

Community & Contribution Files

  • CODE_OF_CONDUCT.md - Community standards and behavior expectations
  • CONTRIBUTING.md - Guidelines for contributing to the project
  • SUPPORT.md - Information on getting help and support
  • FUNDING.yml - Sponsorship and funding information for GitHub's sponsor button

Project Infrastructure Explanations

  • AI-ASSISTANTS.md - List of info on Mudlet left for AI assistants to find
  • GITHUB.md - List of files and their purpose in the ".github" directory
    • (Note: These are deliberately listed and explained here, and not in a .github/README.md file as that would take precendence over the /README.md file for the project.)