Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frameworks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ Optional per-framework files:

- `README.md` -- how to scaffold a new bench app for this framework
- `notes.json` -- small labels recorded into a run, e.g. Vue's
`{ "variant": "Vapor" }`, shown in the results app
`{ "variant": "Vapor" }`, shown in the results app. It can also declare
benches the framework cannot run through the standard command, with the
reason: `{ "skip": { "<bench app>": "why" } }` -- the runner logs and
skips those instead of aborting the run, and the reason is recorded
into the result file with the rest of the notes

## Adding a framework

Expand Down
39 changes: 39 additions & 0 deletions frameworks/marko/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Marko

Creating new benches

There is no client-only Vite template for Marko, so the apps here are
hand-rolled: a plain Vite `index.html` entry pointing at `src/main.js`,
which mounts `src/App.marko` with the template's `.mount()` API, and
`@marko/vite` with `linked: false` (linked mode is for SSR entrypoints).

Copy an existing bench app and replace `src/App.marko`.

Notes:

- These are Marko 6 apps (the tags API): `<let>` for state, `<for>` for
lists, `<script>` for effects that re-run when the state they reference
changes, and `<lifecycle onMount>` for run-once setup. Reactivity is
per-assignment -- mutating an array or Map in place does not update, so
the benches reassign (or, for `ten-k-items-one-time`, give every item
its own `<let>` in a child tag).
- In concise mode (the default at a template's root), a bare `${...}`
line parses as a dynamic tag *name*; root-level text needs the `--`
text prefix (see `ten-k-items-one-time`'s `tags/bench-item.marko`).
- Attribute method shorthands that close over `<for>` loop variables and
get passed to a custom tag can compile to a hoisted function that
loses the loop scope (`$scope is not defined` at runtime). Passing a
`static` function plus the index as separate attributes avoids it.
- Marko's update scheduler has a frame-rate floor (`schedule()` in
marko's `src/dom/schedule.ts`): the first write in a frame renders in
a microtask, every later write waits for the next animation frame.
Bursts coalesce to one render per frame. Two consequences, neither of
which should be "fixed" by forcing `run()` (from `marko/dom`) into the
apps -- that would measure manual flushing instead of Marko:
- the ping-pong `incrementing-render-effect` bench advances exactly
one update per frame, so at its default 100k updates a sample can
never finish; `notes.json` declares it skipped (the runner logs and
records the reason instead of aborting the run)
- the conformance suite paces its writes with `yield=frame` for marko
(see `FRAME_THROTTLED` in `tests/specs/conformance.spec.ts`), so the
anti-cheat trace assertions still fully apply
24 changes: 24 additions & 0 deletions frameworks/marko/dbmon-with-chat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions frameworks/marko/dbmon-with-chat/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Marko: DBMon with Chat</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions frameworks/marko/dbmon-with-chat/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "my-app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"common": "link:../../../common",
"marko": "^6.3.34"
},
"devDependencies": {
"@marko/compiler": "^5.41.18",
"@marko/vite": "^6.1.9",
"vite": "^8.1.1"
}
}
Loading
Loading