# clickblaster
**Repository Path**: mirrors_WebReflection/clickblaster
## Basic Information
- **Project Name**: clickblaster
- **Description**: A benchmark about hooks, clicks, and performance.
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-19
- **Last Updated**: 2026-01-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# ⚡️ [clickblaster](https://webreflection.github.io/clickblaster/) 🔥
An agnostic framework benchmark about repeated, sparse, updates per single element.
Testing hyperHTML and hooks like potentials, to see how these could affect performance.
### Example
```js
// neverland benchmark
const Counter = stardust(() => {
const [count, setCount] = useState(0);
const [icount, setICount] = useState(0);
const {current: increment} = useRef(1 + Math.floor(Math.random() * 5));
// export the `count` value as global
window.count = count;
return html`
Count ${count}
Increment ${increment}
`;
});
// export the global setup
function setup() {
document.body.appendChild(Counter());
}
```
## How To Benchmark
These are the things expected to happen:
* there is a global `window.setup` **function** that, once invoked by the benchmark, populates the `document.body` with the following content (or similar, accordingly to your framework):
```html
Count ${count}
Increment ${increment}
```
If such setup needs to be asynchronous, the `window.setup` can return a `Promise` that will resolve, once the body is available, passing the `button` element.
* the `count` value is a number that starts from `0` and should increment `+ 1` per each ` must have a `clicks` attribute with the same `count` value, updated per each click.
You can see a basic example within the [vanilla](./vanilla/) folder, or a more complex one within the [react-component](./react-component/) one.
In case of build steps, be sure the result can be fully loaded locally without needing to be on the root of the folder.
Once you have a usable test that works, after invoking in console a `setup()`, add a `` to the main [index.html](./index.html) file.
Running `npm run build` should automatically setup all the tests that need it, while running `npm i` should setup all sub folders that need it and then, in both cases, execute `npm run bench`.
Follow up local IPs to test locally, or use [the live page](https://webreflection.github.io/clickblaster/), eventually adding `?100` or `?9000` to change stress level and verify how all frameworks respond.
#### Asynchronous Updates
If your framework of choice doesn't update right away the DOM and needs special handling, it should trigger `top.benchmark()` once its view has been updated.
Please see [VueJS](./vue/src/components/Counter.vue) to understand how this works.
### How to build
You can either `npm i` and then `npm run build` or use `npm run $ build.vue`, as example, to target a specific build.
### How to read results
The result is about **loading** time, followed by **setup** time, and **benchmark** time, all in **milliseconds**.
AS any micro benchmark, so take this with a grain of salt.
PRs for other frameworks, or patterns, are more than welcome. Thanks ❤️