Skip to content

Commit 7ab7d39

Browse files
committed
更新文档
1 parent 2ccf0c3 commit 7ab7d39

9 files changed

Lines changed: 503 additions & 17 deletions

File tree

docs/architecture/call-path-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ sequenceDiagram
6767
| C#→Lua | DelegateBridge / DoString | `[LuaInvoke]` |
6868
| Player | 生成 Wrap 或 IL | C++ 直桥(设计目标) |
6969

70-
详见 [与 xLua 对比](../concepts/comparison-with-xlua)
70+
详见 [ZLua 与 xLua 技术架构对比](../concepts/comparison-with-xlua)
7171

7272
## 相关文档
7373

docs/community/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: ZLua 常见问题与解答(25+ 条)。
1212

1313
### ZLua 与 xLua 有什么区别?
1414

15-
ZLua 在 Il2Cpp 内嵌 Lua、C++ 直桥,不生成 C# Wrap。类型访问用 `CSharp` 根表,C# 调 Lua 用 `[LuaInvoke]`。选型理由见 **[为什么选择 ZLua](../concepts/why-zlua)**;架构与理论性能见 [与 xLua 对比](../concepts/comparison-with-xlua);迁移见 [迁移对照草稿](./migration-from-xlua)
15+
ZLua 在 Il2Cpp 内嵌 Lua、C++ 直桥,不生成 C# Wrap。类型访问用 `CSharp` 根表,C# 调 Lua 用 `[LuaInvoke]`。选型理由见 **[为什么选择 ZLua](../concepts/why-zlua)**;架构与理论性能见 [ZLua 与 xLua 技术架构对比](../concepts/comparison-with-xlua);迁移见 [迁移对照草稿](./migration-from-xlua)
1616

1717
### Mono 和 Il2Cpp 差别有多大?
1818

docs/community/migration-from-xlua.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: 从 xLua / tolua 迁移到 ZLua 的对照草稿(v2.0 完整版规
77
# 从 xLua 迁移
88

99
:::info 对照草稿
10-
本文为 **迁移对照草稿**,便于评估与试点迁移;完整迁移指南、工具与案例计划在 **v2.0**。架构差异见 [与 xLua 对比](../concepts/comparison-with-xlua)
10+
本文为 **迁移对照草稿**,便于评估与试点迁移;完整迁移指南、工具与案例计划在 **v2.0**。架构差异见 [ZLua 与 xLua 技术架构对比](../concepts/comparison-with-xlua)
1111
:::
1212

1313
## 何时考虑迁移
@@ -128,7 +128,7 @@ obj:Subscribe(function(x) print(x) end) -- 隐式 marshal,见回调指南
128128

129129
## 建议迁移步骤(草稿)
130130

131-
1. **并行评估** — 只读 [与 xLua 对比](../concepts/comparison-with-xlua),确认 Il2Cpp 路线与 MVP 边界
131+
1. **并行评估** — 只读 [ZLua 与 xLua 技术架构对比](../concepts/comparison-with-xlua),确认 Il2Cpp 路线与 MVP 边界
132132
2. **搭骨架** — clone zlua-demo,替换 `Demo.cs` / `app.lua` 为最小业务
133133
3. **迁 Lua 层**`CS.``CSharp.{asm}.`;namespace 改括号访问
134134
4. **迁 C# 调 Lua**`GetFunction` / `DoString``[LuaInvoke]`
@@ -152,7 +152,7 @@ obj:Subscribe(function(x) print(x) end) -- 隐式 marshal,见回调指南
152152

153153
## 相关文档
154154

155-
- [与 xLua 对比](../concepts/comparison-with-xlua)
155+
- [ZLua 与 xLua 技术架构对比](../concepts/comparison-with-xlua)
156156
- [路线图](./roadmap) — v2.0 完整迁移指南
157157
- [快速开始](../getting-started/quick-start)
158158
- [排错指南](../guides/troubleshooting)

docs/concepts/comparison-with-xlua.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
mdx:
33
format: md
44
sidebar_position: 6
5-
title: 与 xLua 对比
6-
description: 架构、调用路径与理论开销对比,供技术选型参考
5+
title: ZLua 与 xLua 技术架构对比
6+
description: 与 xLua 的架构、调用路径与理论开销推演,供性能评审参考
77
---
88

9-
# ZLua 与 xLua 对比分析
9+
# ZLua 与 xLua 技术架构对比
1010

1111
本文档从 **架构、调用路径、理论开销** 三方面对比 ZLua 与 xLua(Tencent,Unity Il2Cpp 常用方案)。用于技术选型与设计评审。
1212

13-
**选型理由(用法、GC、Wrapper 等)** 请先读 [为什么选择 ZLua](./why-zlua);本文侧重 **路径级性能推演**
13+
**选型理由(用法、GC、Wrapper 等)** 请先读 [为什么选择 ZLua](./why-zlua)**基于 xLua Examples 的用法逐项对照与详证**[ZLua 与 xLua 全面对比报告](./xlua-comparison-report)本文侧重 **路径级性能推演**
1414

1515
**说明:**
1616

docs/concepts/design-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ flowchart TB
8585
| C#→Lua | `LuaEnv.DoString` / DelegateBridge | `[LuaInvoke]` 声明式 |
8686
| Player 性能 | Wrap 或生成 C++(视配置) | 设计目标:C++ 直桥 + 签名复用 |
8787

88-
详见 [与 xLua 对比](./comparison-with-xlua)[调用路径概览](../architecture/call-path-overview)
88+
详见 [ZLua 与 xLua 技术架构对比](./comparison-with-xlua)[调用路径概览](../architecture/call-path-overview)
8989

9090
## 何时读哪份文档
9191

docs/concepts/why-zlua.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ xLua、tolua 已是 Unity Lua 绑定的成熟选择。ZLua 不是「多一个绑
2828

2929
:::info 读前须知
3030
- 上表 **Player** 列以 [项目状态](../getting-started/project-status) 为准;性能/GC 的 **设计目标** 不等于 **当前 MVP 实测**
31-
- 路径级性能倍数为 **理论推演**,尚无官方 benchmark → [与 xLua 对比](./comparison-with-xlua)
31+
- 路径级性能倍数为 **理论推演**,尚无官方 benchmark → [ZLua 与 xLua 技术架构对比](./comparison-with-xlua)
3232
- Il2Cpp 完整版预计 **2026 年 8 月**[路线图](../community/roadmap)
3333
:::
3434

@@ -50,7 +50,7 @@ flowchart TD
5050
|--------|------|
5151
| **新项目、性能敏感、愿跟路线图** | 读本页 → [5 分钟快速开始](../getting-started/quick-start)[zlua-demo](https://github.com/focus-creative-games/zlua-demo) |
5252
| **已有 xLua/tolua 存量、近期上线** | 先看 [不适合](#不适合选-zlua)[迁移草稿](../community/migration-from-xlua) |
53-
| **架构 / 性能 reviewer** | 本页 + [与 xLua 对比](./comparison-with-xlua) + [Il2Cpp 架构](../architecture/il2cpp-architecture) |
53+
| **架构 / 性能 reviewer** | 本页 + [ZLua 与 xLua 技术架构对比](./comparison-with-xlua) + [Il2Cpp 架构](../architecture/il2cpp-architecture) |
5454
| **只关心 API 能不能用** | [兼容性矩阵](../getting-started/compatibility) + Mono Editor 开发 |
5555

5656
---
@@ -175,7 +175,7 @@ flowchart LR
175175
|`int` 字段 | 常经 Wrap | **offset 直读**(规范) |
176176
| 桥接体积 | 每类型大量 Wrap | **按签名复用** MethodBridge |
177177

178-
**为何有机会快数倍(热路径、理论值):** 消灭 libxlua 往返与 C# Wrap 层;具体场景倍数见 [与 xLua 对比 §4](./comparison-with-xlua#4-分场景理论估计)**非实测**)。
178+
**为何有机会快数倍(热路径、理论值):** 消灭 libxlua 往返与 C# Wrap 层;具体场景倍数见 [ZLua 与 xLua 技术架构对比 §4](./comparison-with-xlua#4-分场景理论估计)**非实测**)。
179179

180180
### 今天能用吗
181181

@@ -293,7 +293,7 @@ tolua 依赖 **导出的 binding 代码**;xLua 依赖 **Generate + LuaCallCSha
293293

294294
1. **5 分钟上手**[快速开始](../getting-started/quick-start) + [zlua-demo](https://github.com/focus-creative-games/zlua-demo)
295295
2. **确认 Player 边界**[项目状态](../getting-started/project-status) · [兼容性](../getting-started/compatibility)
296-
3. **深度对比**[与 xLua 对比](./comparison-with-xlua)(路径与理论性能)
296+
3. **深度对比**[ZLua 与 xLua 技术架构对比](./comparison-with-xlua)(路径与理论性能)· [ZLua 与 xLua 全面对比报告](./xlua-comparison-report)(Examples 用法对照
297297
4. **已有 xLua**[迁移对照草稿](../community/migration-from-xlua)
298298

299299
---
@@ -302,7 +302,8 @@ tolua 依赖 **导出的 binding 代码**;xLua 依赖 **Generate + LuaCallCSha
302302

303303
| 文档 | 内容 |
304304
|------|------|
305-
| [与 xLua 对比](./comparison-with-xlua) | 调用栈、ns 量级推演 |
305+
| [ZLua 与 xLua 技术架构对比](./comparison-with-xlua) | 调用栈、ns 量级推演 |
306+
| [ZLua 与 xLua 全面对比报告](./xlua-comparison-report) | Examples 详证 + 用法逐项对照 |
306307
| [设计概览](./design-overview) | L/Invoke 与自动生成流水线 |
307308
| [Il2Cpp 架构](../architecture/il2cpp-architecture) | Player C++ 实现 |
308309
| [Struct 编组](../spec/marshal/struct) | GC 路径完整规范 |

0 commit comments

Comments
 (0)