Skip to content

chore: remove Boost::regex, fix benchmarks/warnings, and refresh docs - #72

Merged
cursor[bot] merged 1 commit into
masterfrom
cursor/remove-boost-regex-and-refresh-docs-c9d3
Dec 2, 2026
Merged

cursor[bot] merged 1 commit into
masterfrom
cursor/remove-boost-regex-and-refresh-docs-c9d3

Conversation

@esrrhs

@esrrhs esrrhs commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Summary

Implements P5 hygiene, dependency slimming, and benchmark/documentation refresh on top of post-PR #68/#69/#70/#71 master:

  1. Remove Boost::regex dependency

    • Replaced boost::regex in IsNumber and IsInteger (src/util/string_util.cpp) with hand-written ASCII scanners preserving the exact semantics of the original regexes (ReplaceEscapeChars untouched).
    • Removed regex from BOOST_INCLUDE_LIBRARIES, ${BOOST_SOURCE_DIR}/libs/regex/include, and Boost::regex from TARGET_LIB in src/CMakeLists.txt.
    • Expanded common.IsNumber and common.IsInteger in test/test_common.cpp with edge-case unit tests.
  2. Fix distorted benchmarks, compiler warnings, and CMake duplication

    • benchmark/benchmark_function.cpp: updated bench_multi_return / inner_multi to actually return and unpack 3 values (x, x * 2, x * 3).
    • benchmark/benchmark_table.cpp: updated bench_table_pack to actually call table.pack(...).
    • benchmark/benchmark_string.cpp: aligned BM_CPP_ToString to a single std::to_string(n) call (matching Lua/FakeLua) and switched BM_Lua_ToString to CallLuaString.
    • Eliminated all 14 compiler warnings across benchmark/ (12 deprecated const-ref benchmark::DoNotOptimize calls) and test/ (-Wunused-result in test/test_jitter.cpp, -Wdangling-else in test/test_net.cpp).
    • Deduplicated the 3× pasted CPM OPTIONS in benchmark/CMakeLists.txt.
  3. Refresh benchmark and native module documentation

    • Updated benchmark/README.md and benchmark/README.zh.md with freshly measured core-pinned Release (-O3 -DNDEBUG) results against PUC-Rio Lua 5.4.8, including StringFindLiteral and NativeObject.
    • Updated src/native/README.md (added missing yaml, toml, xml, ini, log modules) and src/native/README.zh.md (added missing log module), and updated stale Boost.Beast / Asio io_context / Boost.Redis / Boost.Process v2 / Boost.Math / Boost.Algorithm (math.clamp) references to the actual implementations (libevent, hiredis, POSIX fork/execve/waitpid + Win32 CreateProcessW, std::erf/std::clamp).

Verification

  • Release build (GCC 13.3.0, -O3 -DNDEBUG) builds libfakelua.so, flua, unit_tests, and bench_mark cleanly with 0 compiler warnings across src/, cmd/, test/, and benchmark/.
  • flua cmd/test.lua passes (exit 0) across all 3 backends (TCC, GCC, INTERP).
  • unit_tests (with FAKELUA_HOME=/agent/repos/fakelua): 1858 / 1881 passed (the 23 failures are exclusively test_mysql.* / test_redis.* without local MySQL/Redis daemons in the container), including expanded common.IsNumber and common.IsInteger tests.
  • Full bench_mark suite run pinned to core 0 (taskset -c 0 ./bench_mark --benchmark_min_time=0.2s --benchmark_repetitions=1) against Lua 5.4.8: GCC leads Lua on 50/51 compared scenarios (StringFind 3.22x, StringFindLiteral 2.77x, StringGmatch 1.65x, StringFindPattern 1.06x, Fibonacci 45.06x, MathSqrt 16.27x).
Open in Web Open in Cursor 

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.53%. Comparing base (b686d2e) to head (e1e7a61).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #72   +/-   ##
=======================================
  Coverage   94.52%   94.53%           
=======================================
  Files         130      130           
  Lines       32588    32644   +56     
=======================================
+ Hits        30803    30859   +56     
  Misses       1785     1785           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cursor
cursor Bot merged commit 22e9cb9 into master Dec 2, 2026
9 checks passed
@cursor
cursor Bot deleted the cursor/remove-boost-regex-and-refresh-docs-c9d3 branch December 2, 2026 06:11
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.

3 participants