Skip to content

Cache preformatted tokens in statistics task - #2024

Merged
mutatrum merged 1 commit into
bitaxeorg:masterfrom
mutatrum:feature/statistics-preformatted-cache
Oct 12, 2026
Merged

mutatrum merged 1 commit into
bitaxeorg:masterfrom
mutatrum:feature/statistics-preformatted-cache

Conversation

@mutatrum

@mutatrum mutatrum commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Follow-up of #2016. This change amortises the serialisation time of all values at stats collection time. When the front-end then requests a full 720 point snapshot, the serializer just dumps the strings. This reduced lock time on the statistics object, reduces TTFB and response time.

Stock cJSON sprintf yyjson pre-formatted
Time to First Byte (TTFB) ~316 ms ~36 ms ~61 ms ~25 ms
Total Response Time ~357 - 400 ms ~61 - 75 ms ~105 - 131 ms ~76 – 103 m
Transferred Payload Size 56.8 KB 38.0 KB 37.8 KB 38.0 KB

It also makes the code simpler, http_server no longer has knowledge of which fields there are and several lists have been eliminated.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Test Results

  2 files  ±0    2 suites  ±0   1s ⏱️ -1s
252 tests ±0  252 ✅ ±0  0 💤 ±0  0 ❌ ±0 
254 runs  ±0  254 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 06de123. ± Comparison against base commit 405a7bf.

@0xf0xx0 0xf0xx0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ack

@mutatrum
mutatrum merged commit 22c09cb into bitaxeorg:master Oct 12, 2026
4 checks passed
@mutatrum
mutatrum deleted the feature/statistics-preformatted-cache branch October 12, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants