优化原生结果编码传输与浏览器缓存,记录八路性能基线

原生结果series通过字节索引直传,C端使用Ryu精确回读编码和64 KiB批量写出;网页采用Float64缓存和CSV工作线程,减少结果处理与保存等待。

补充八路AME曲线核查、全流程分阶段计时、独立编码基准和复现工具,固定后续优化采用修正八路及rtol=1e-8。C写出1.1808→0.1638 s,点击到可查看8.0100→6.9756 s。

验证:最终10项编码专项、29项相关后端回归通过;8份原生结果逐位一致,16次网页结果/CSV/刷新恢复通过。前端构建及缓存/CSV专项在本轮结果处理工作中通过。环境、原始大结果与临时构建不纳入Git。
This commit is contained in:
lujingze committed 2026-09-11 15:09:15 +00:00
1 parent 808c484f5b
commit 3bc4be3c06
55 files changed
+20522 -141

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#ifndef NATIVE_JSON_NUMBERS_H
#define NATIVE_JSON_NUMBERS_H
#include <stddef.h>
#include <stdio.h>
#define NATIVE_JSON_DOUBLE_CAPACITY 32
/* Locale-independent finite binary64 token; no terminating NUL is promised.
* Returns its length, or zero for NaN/Infinity. Negative zero is -0.0 so both
* Python and JavaScript JSON readers preserve its sign. */
int native_json_format_double(char output[NATIVE_JSON_DOUBLE_CAPACITY], double value);
/* Write a number, or a complete array from values[i*stride]. Each call flushes
* its own fixed-size buffer into FILE, but does not fflush/fclose the FILE.
* Return zero on invalid input/nonfinite values/write failure. A failed array
* may have written a prefix: callers must not publish that document as valid.
* The caller owns FILE and must check its final flush/close before publishing. */
int native_json_write_number(FILE *file, double value);
int native_json_write_array(FILE *file, const double *values, size_t count, size_t stride);
#endif