[0082] bytevector-base64-encode 下沉到 native C++ 实现#880
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(liii base64)的bytevector-base64-encode从纯 Scheme 实现下沉到 native C++,与 0080 decode 下沉思路对称src/liii_base64.cpp新增f_bytevector_base64_encode,每 3 字节打包成 triple 按 6-bit 切分查表,尾部处理==/=填充goldfish/liii/base64.scmencode 转发到 native,删除原 Scheme 循环及BYTE2BASE64_BV/BASE64_PAD_BYTE常量devel/0082.md记录任务与性能对比性能对比(debug 构建,单次平均耗时)
(liii base64)的 bytevector 编解码两端现均跑在 native 层;string-base64-encode经 `utf8->string ∘ bytevector-base64-encode` 复用,瓶颈转移到 utf8 转换层。Test plan
bin/gf tests/liii/base64/bytevector-base64-encode-test.scm— 22 correct, 0 failedbin/gf tests/liii/base64/bytevector-base64-decode-test.scm— 36 correct, 0 failedbin/gf tests/liii/base64/base64-encode-test.scm— 10 correct, 0 failedbin/gf tests/liii/base64/base64-decode-test.scm— 9 correct, 0 failedbin/gf bench/bytevector-base64-encode-perf.scm— before/after 数据已记录🤖 Generated with Claude Code