Skip to content

Commit 849adf7

Browse files
committed
[chore] bump version to v2.6.8
1 parent 4d080b7 commit 849adf7

7 files changed

Lines changed: 20 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [2.6.8] - 2026-08-09
99

1010
### Added
1111
- **CompileTimeJson 编译期直序列化**`CompileTimeJson` 模板把 DTO 结构体的 JSON 序列化在编译期展开成 flat 字符串拼接链,完全绕开 `boost::json::object` 的运行时分配——不建 object、不调 `serialize()`、零堆分配。`HttpResponse::jsonFrom<T>()` 便捷 API 一行搞定编译期序列化响应,对简单 DTO 比 `toJson` + `boost::json::serialize` 快一个数量级。配套测试 `test_compile_time_json`(含 `vector<bool>` 代理类不兼容修复)
1212
- **PerfectHashRouter 编译期完美哈希路由表**:静态路由把 `unordered_map` 查找替换为编译期算好的完美哈希,运行时只需 djb2 哈希 + 乘法 + 位移 + 一次字符串比较,没有除法取模也没分支预测翻车。实现用 multiply-shift 方案编译期暴力搜无冲突种子,`MetaRoutes` 注册路由时自动构建并注入 `Router`,命中跳 `unordered_map`、miss 回退原查表逻辑。配套测试覆盖全命中/miss/方法不匹配/边界条件,静态路由查找延迟对比 benchmark (`test_perfect_hash_router`
1313
- **CompileTimeChain 编译期中间件链预构建**`CompileTimeChain` 模板在编译期把中间件类型列表展开成调用链,连续 Sync 条目合并到一个协程帧,语义跟 `buildOptimizedChain` 对齐。`compileTimeRoute` 注册的路由 dispatch 时优先走预构建链,跳过动态构建。`Router``RouteEntry``ParamRouteEntry` 都加了 `compileTimeChain` 字段,dispatch/dispatchSync 先看有没有编译期链,没有才回退到动态路径
14+
- **NUMA 拓扑感知调度**`HICAL_WITH_NUMA`):`NumaTopology` 启动时检测 NUMA 拓扑(节点数、CPU 分布、节点间距),`EventLoopPool` 用这个信息把 worker 线程均匀分布到各节点并就近绑核,`MemoryPool` 优先从本地节点分配内存(`numa_set_preferred`)。单路或 WSL 这种不支持 NUMA 的环境自动退化 UMA 模式,行为跟之前一样
1415
- **HttpArena bench 服务器接入 Gzip 压缩**:bench 服务器接入 Gzip 压缩中间件,新增 `json-comp` 测试类型
1516

1617
### Fixed
1718
- **C++26 反射特性检测宏修正**[#13](https://github.com/Hical61/Hical/issues/13)):`__cpp_reflection` 是旧版 Reflection TS 的宏名,P2996 最终版拆成了 `__cpp_impl_reflection``__cpp_lib_reflection`。P2996R13 合并了 P3547R1,`nonstatic_data_members_of``nonstatic_member_functions_of` 都加了第二个 `access_context` 参数。GCC16 开了 `-freflection` 也能检测到了
19+
- **TlContentCache 淘汰路径 use-after-free**`index.erase(it->second->key)` 把当前 hash node 干掉后下一行又读 `it->second`,CI ASan 报 heap-use-after-free。修复是把 list 迭代器先取出来,再用 `it` 删 index,最后删 list 条目
1820
- **HttpArena bench 修复**:补了缺失的 `RouteGroup.h` 头文件;Gzip 中间件从全局移到 `/json` 路由组,避免拖慢 static 文件服务;`SyncAfterHandler` 包装为协程以匹配 `server.use()` 签名
1921
- **tests/CMakeLists.txt CI 修复**:合并提交时文件换行丢失被粘成一行,CMake 解析报 `Parse error`,三个平台全挂,从远端还原并补回 `test_perfect_hash_router` 注册行
20-
- **PerfectHash 性能测试阈值放宽**`PerfectHashPerfTest` 性能阈值从严格 ratio 改为仅检查 `nsPerOp < 1e6`,移除 `FirstAndLastHit` ratio 断言——CI 共享 CPU 噪声太大(已连踩 1.32 和 1.56),继续放宽阈值没意义
22+
- **PerfectHash 性能测试阈值放宽**`PerfectHashPerfTest` 性能阈值从严格 ratio 改为仅检查 `nsPerOp < 1e6`,移除 `FirstAndLastHit` ratio 断言——CI 共享 CPU 噪声太大(已连踩 1.32 和 1.56),继续放宽阈值没意义。MSVC 没 HALO(协程帧全堆分配),sync/async 耗时上限额外放宽
2123

2224
### Performance
2325
- **toJson 预分配 reserve(N) 消除 rehash**`toJson` 在构造 `boost::json::object` 时调用 `reserve(fieldsCount)` 预分配桶,消除字段数超过默认容量时的 rehash 开销
@@ -26,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2628
- **PathCache 无锁化**:从全局 `shared_mutex` + LRU 改为每线程独立 `thread_local` LRU(单线程 64 条目,64 核总容量 ~4096),彻底消除跨核缓存行弹跳,解决 static/4096 −38%、static/6800 −48% 的高并发退化。缓存 key 加 root 前缀(`\x01` 分隔)隔离不同 `serveStatic` handler
2729
- **StaticFiles isTextMime 分流**:文本文件走 `setBody`(2 次协程挂起 + 单次 scatter-gather),二进制走 `setFileBody` 流式发送,避免 `random_access_file` 构造函数的同步 `open()` 在高并发下阻塞 io_context
2830
- **Gzip isCompressible() 跳过已压缩格式**:碰到 `image/webp``font/woff2``video/mp4` 这些本来就是压缩过的二进制内容直接跳过,不用白跑 deflate
31+
- **NUMA 感知内存分配**`MemoryPool` 通过 `numa_set_preferred` 让 PMR 分配优先走本地内存节点,`EventLoopPool` 线程分布到各 NUMA 节点内轮询绑 CPU,多路服务器上避免跨节点访问延迟
2932

3033
## [2.6.7] - 2026-07-15
3134

@@ -477,7 +480,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
477480
- Multipart Part 数量上限(DoS 防护)
478481
- Session ID 使用密码学安全的随机数生成
479482

480-
[Unreleased]: https://github.com/Hical61/Hical/compare/v2.6.7...HEAD
483+
[Unreleased]: https://github.com/Hical61/Hical/compare/v2.6.8...HEAD
484+
[2.6.8]: https://github.com/Hical61/Hical/compare/v2.6.7...v2.6.8
481485
[2.6.7]: https://github.com/Hical61/Hical/compare/v2.6.6...v2.6.7
482486
[2.6.6]: https://github.com/Hical61/Hical/compare/v2.6.5...v2.6.6
483487
[2.6.5]: https://github.com/Hical61/Hical/compare/v2.6.4...v2.6.5

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.20)
2-
project(hical VERSION 2.6.7 LANGUAGES C CXX)
2+
project(hical VERSION 2.6.8 LANGUAGES C CXX)
33

44
# C++26 反射可选支持
55
option(HICAL_ENABLE_REFLECTION "Enable C++26 reflection (requires compatible compiler)" OFF)

docs/quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ target_link_libraries(my_app PRIVATE hical::hical_core)
9898

9999
```bash
100100
# Download source package from GitHub Releases
101-
curl -LO https://github.com/Hical61/Hical/releases/download/v2.6.7/hical-2.6.7-conan-src.tar.gz
102-
tar xzf hical-2.6.7-conan-src.tar.gz && cd hical
103-
conan export . --version=2.6.7
101+
curl -LO https://github.com/Hical61/Hical/releases/download/v2.6.8/hical-2.6.8-conan-src.tar.gz
102+
tar xzf hical-2.6.8-conan-src.tar.gz && cd hical
103+
conan export . --version=2.6.8
104104
```
105105

106106
In your consumer project:

docs/quickstart_cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ target_link_libraries(my_app PRIVATE hical::hical_core)
9898

9999
```bash
100100
# 从 GitHub Releases 下载源码包
101-
curl -LO https://github.com/Hical61/Hical/releases/download/v2.6.7/hical-2.6.7-conan-src.tar.gz
102-
tar xzf hical-2.6.7-conan-src.tar.gz && cd hical
103-
conan export . --version=2.6.7
101+
curl -LO https://github.com/Hical61/Hical/releases/download/v2.6.8/hical-2.6.8-conan-src.tar.gz
102+
tar xzf hical-2.6.8-conan-src.tar.gz && cd hical
103+
conan export . --version=2.6.8
104104
```
105105

106106
在消费者项目中:

ports/hical61-hical/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hical61-hical",
3-
"version": "2.6.7",
3+
"version": "2.6.8",
44
"description": "Modern C++20/C++26 high-performance web framework based on Boost.Asio with native HTTP/WebSocket stack",
55
"homepage": "https://github.com/Hical61/Hical",
66
"license": "MIT",

ports/hical61-hical/versions_template.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"versions": [
3+
{
4+
"version": "2.6.8",
5+
"git-tree": "PLACEHOLDER_RUN_STEP_5_TO_FILL"
6+
},
37
{
48
"version": "2.6.7",
59
"git-tree": "PLACEHOLDER_RUN_STEP_5_TO_FILL"

vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hical",
3-
"version": "2.6.7",
3+
"version": "2.6.8",
44
"dependencies": [
55
"boost-asio",
66
"boost-system",

0 commit comments

Comments
 (0)