Skip to content

Commit 8a08063

Browse files
authored
Merge pull request #73 from crisanlucid/chore/rebrand-primusread
docs: add Performance section with 57x speedup commit link
2 parents df3bd19 + a8de5f9 commit 8a08063

2 files changed

Lines changed: 56 additions & 41 deletions

File tree

README.md

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,30 @@ Open-source **React**, **Vite**, **Tailwind CSS** & **TypeScript** tool that acc
3030
| Dark mode | Light/dark theme toggle with `localStorage` persistence | :heavy_check_mark:
3131
| File import (TXT, DOCX, PDF, EPUB) | Import files via advanced mode toggle — parsed client-side, files never leave the browser | :heavy_check_mark:
3232
| Bionic EPUB export | Export a bionic-formatted `.epub` file with `<b>` fixation points applied to all HTML chapters | :heavy_check_mark:
33+
| [57× Unicode speedup][perf-commit] | Hoist `toUnicodeVariant` constants to module scope — data structures built once at load time instead of once per word | :heavy_check_mark:
3334
| Show characters | Display Characters after textarea | backlog
3435
| Increase fonts | Create functionality to increase/descrease fonts size | backlog
3536

37+
[perf-commit]: https://github.com/crisanlucid/primusread/commit/1bd266d8f973ce9d83bfb016e0e1405f48ccf197
38+
3639

3740
### How to Run
3841

3942
```bash
4043
npm install && npm run dev
4144
```
4245

46+
## Performance
47+
48+
Unicode mode (`toUnicodeVariant`) was originally rebuilding all data structures on every call. [Hoisting constants to module scope][perf-commit] reduced the per-call overhead to zero, yielding a **57× throughput improvement** on a 500-word document (86 ops/s → 4,915 ops/s).
49+
50+
| Mode | 500-word document |
51+
|---|---|
52+
| CSS mode (default) | ~15,700 ops/s |
53+
| Unicode mode (after fix) | ~4,900 ops/s |
54+
55+
Run the benchmark yourself: `npm run bench`
56+
4357
## PDF functionality
4458
![Save text as PDF file](./src/assets/primusread_pdf_export.PNG)
4559

@@ -67,47 +81,7 @@ Pull requests are welcome :)
6781

6882
---
6983

70-
## Release Flow
71-
72-
Step-by-step guide for releasing a new version.
73-
74-
### 1. Develop on a feature branch
75-
76-
```bash
77-
git checkout -b feature/my-feature
78-
# ... make changes ...
79-
git add <files>
80-
git commit -m "feat: my feature"
81-
git push origin feature/my-feature
82-
```
83-
84-
### 2. Open a Pull Request → merge into `main`
85-
86-
Opening a PR triggers:
87-
- **Node.js CI** — installs deps, builds, runs tests
88-
- **CodeQL** — security scan
89-
90-
Merging into `main` additionally triggers:
91-
- **Build and Deploy** — deploys to GitHub Pages (only when source files change)
92-
93-
### 3. Bump the version
94-
95-
Go to **Actions → Bump version → Run workflow** and choose:
96-
- `patch` → bug fixes / small improvements (0.5.0 → 0.5.1)
97-
- `minor` → new features, backwards compatible (0.5.0 → 0.6.0)
98-
- `major` → breaking changes (0.5.0 → 1.0.0)
99-
100-
This workflow will:
101-
- Bump `package.json` + `package-lock.json` version
102-
- Create a git tag (e.g. `v0.6.0`) and push it
103-
- Open a PR named `chore: bump version to vX.X.X`
104-
105-
### 4. Merge the version bump PR
106-
107-
Merge the `chore: bump version to vX.X.X` PR into `main`. This automatically:
108-
- Runs CI (install, build, test)
109-
- Deploys to GitHub Pages
110-
- **Creates a GitHub Release** with auto-generated notes
84+
For the step-by-step release process see [ReleaseFlow.md](./ReleaseFlow.md).
11185

11286
---
11387

ReleaseFlow.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Release Flow
2+
3+
Step-by-step guide for releasing a new version.
4+
5+
### 1. Develop on a feature branch
6+
7+
```bash
8+
git checkout -b feature/my-feature
9+
# ... make changes ...
10+
git add <files>
11+
git commit -m "feat: my feature"
12+
git push origin feature/my-feature
13+
```
14+
15+
### 2. Open a Pull Request → merge into `main`
16+
17+
Opening a PR triggers:
18+
- **Node.js CI** — installs deps, builds, runs tests
19+
- **CodeQL** — security scan
20+
21+
Merging into `main` additionally triggers:
22+
- **Build and Deploy** — deploys to GitHub Pages (only when source files change)
23+
24+
### 3. Bump the version
25+
26+
Go to **Actions → Bump version → Run workflow** and choose:
27+
- `patch` → bug fixes / small improvements (0.5.0 → 0.5.1)
28+
- `minor` → new features, backwards compatible (0.5.0 → 0.6.0)
29+
- `major` → breaking changes (0.5.0 → 1.0.0)
30+
31+
This workflow will:
32+
- Bump `package.json` + `package-lock.json` version
33+
- Create a git tag (e.g. `v0.6.0`) and push it
34+
- Open a PR named `chore: bump version to vX.X.X`
35+
36+
### 4. Merge the version bump PR
37+
38+
Merge the `chore: bump version to vX.X.X` PR into `main`. This automatically:
39+
- Runs CI (install, build, test)
40+
- Deploys to GitHub Pages
41+
- **Creates a GitHub Release** with auto-generated notes

0 commit comments

Comments
 (0)