Skip to content

Commit 42de725

Browse files
authored
doc: slightly improve the wording (#692)
1 parent 8ef55d0 commit 42de725

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

next/language/benchmarks.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ There is no `keep` function available as a standalone function; it is a method o
7676
The output may look like this:
7777

7878
```json
79+
6765
7980
{
8081
"name": "fib",
8182
"sum": 217.22039973878972,

next/locales/zh_CN/LC_MESSAGES/language.po

+8-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: MoonBit Document \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-04-30 14:56+0800\n"
11+
"POT-Creation-Date: 2025-04-30 15:56+0800\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language: zh_CN\n"
@@ -576,8 +576,7 @@ msgid ""
576576
"abstract `Summary` type, which can be serialized into JSON format. The "
577577
"stability of the `Summary` type is not guaranteed to be stable."
578578
msgstr ""
579-
"有时用户可能希望获取原始基准统计数据以进行进一步的分析。"
580-
"有一个函数 `@bench.single_bench` 返回一个抽象的 `Summary`"
579+
"有时用户可能希望获取原始基准统计数据以进行进一步的分析。有一个函数 `@bench.single_bench` 返回一个抽象的 `Summary`"
581580
" 类型,用户可以将其序列化为 JSON 格式。我们不保证 `Summary` 类型内部字段的稳定性。"
582581

583582
#: ../../language/benchmarks.md:67
@@ -586,8 +585,8 @@ msgid ""
586585
"away. There is no `keep` function available as a standalone function; it "
587586
"is a method of `@bench.T`."
588587
msgstr ""
589-
"在使用 `@bench.single_bench` 时,用户必须确保计算没有被优化掉。"
590-
"此时没有独立的 `keep` 函数可用;之前介绍过的 `keep` 是 `@bench.T` 的一个方法。"
588+
"在使用 `@bench.single_bench` 时,用户必须确保计算没有被优化掉。此时没有独立的 `keep` 函数可用;之前介绍过的 "
589+
"`keep` 是 `@bench.T` 的一个方法。"
591590

592591
#: ../../language/benchmarks.md:70
593592
msgid ""
@@ -598,7 +597,7 @@ msgid ""
598597
" saved = fib(20)\n"
599598
" })\n"
600599
" println(saved)\n"
601-
" println(summary.to_json().stringify())\n"
600+
" println(summary.to_json().stringify(escape_slash=true, indent=4))\n"
602601
"}\n"
603602
msgstr ""
604603
"fn collect_bench() -> Unit {\n"
@@ -617,6 +616,7 @@ msgstr "输出可能如下所示:"
617616

618617
#: ../../language/benchmarks.md:78
619618
msgid ""
619+
"6765\n"
620620
"{\n"
621621
" \"name\": \"fib\",\n"
622622
" \"sum\": 217.22039973878972,\n"
@@ -639,6 +639,7 @@ msgid ""
639639
" \"runs\": 10\n"
640640
"}\n"
641641
msgstr ""
642+
"6765\n"
642643
"{\n"
643644
" \"name\": \"fib\",\n"
644645
" \"sum\": 217.22039973878972,\n"
@@ -661,7 +662,7 @@ msgstr ""
661662
" \"runs\": 10\n"
662663
"}\n"
663664

664-
#: ../../language/benchmarks.md:102
665+
#: ../../language/benchmarks.md:103
665666
msgid "Time units are in microseconds."
666667
msgstr "时间单位均为微秒。"
667668

next/sources/language/src/benchmark/top.mbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ fn collect_bench() -> Unit {
4646
saved = fib(20)
4747
})
4848
println(saved)
49-
println(summary.to_json().stringify())
49+
println(summary.to_json().stringify(escape_slash=true, indent=4))
5050
}
5151
// end bench 4

0 commit comments

Comments
 (0)