This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git
The following commit(s) were added to refs/heads/main by this push:
new d8f53c5e3 chore: fix typos (#2436)
d8f53c5e3 is described below
commit d8f53c5e3d46e010c3c84dd70e42fb7504c4771a
Author: co63oc <[email protected]>
AuthorDate: Fri Aug 1 18:47:47 2025 +0800
chore: fix typos (#2436)
<!--
**Thanks for contributing to Fory.**
**If this is your first time opening a PR on fory, you can refer to
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).**
Contribution Checklist
- The **Apache Fory** community has requirements on the naming of pr
titles. You can also find instructions in
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).
- Fory has a strong focus on performance. If the PR you submit will have
an impact on performance, please benchmark it first and provide the
benchmark result here.
-->
## What does this PR do?
chore: fix typos
translate comments
<!-- Describe the purpose of this PR. -->
## Related issues
<!--
Is there any related issue? Please attach here.
- #xxxx0
- #xxxx1
- #xxxx2
-->
## Does this PR introduce any user-facing change?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fory/issues/new/choose) describing the
need to do so and update the document if necessary.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
---
.../codegen/analyze/impl/type/type_system_analyzer.dart | 2 +-
dart/packages/fory/lib/src/codegen/generate/builders.dart | 4 ++--
java/benchmark/analyze.py | 15 ++++++++-------
.../java/org/apache/fory/benchmark/util/MsgpackUtil.java | 8 ++++----
python/pyfory/meta/metastring.py | 4 ++--
rust/fory-core/src/meta/string_util.rs | 2 +-
6 files changed, 18 insertions(+), 17 deletions(-)
diff --git
a/dart/packages/fory/lib/src/codegen/analyze/impl/type/type_system_analyzer.dart
b/dart/packages/fory/lib/src/codegen/analyze/impl/type/type_system_analyzer.dart
index 8d736d01e..a357dd9f7 100644
---
a/dart/packages/fory/lib/src/codegen/analyze/impl/type/type_system_analyzer.dart
+++
b/dart/packages/fory/lib/src/codegen/analyze/impl/type/type_system_analyzer.dart
@@ -38,7 +38,7 @@ class TypeSystemAnalyzer{
@LocationEnsure(LocationLevel.fieldLevel)LocationMark locationMark,
){
assert(locationMark.ensureFieldLevel);
- // 确认现在的ObjType
+ // Confirm the current ObjType
Either<ObjTypeWrapper, DartTypeEnum> res =
Analyzer.customTypeAnalyzer.analyzeType(element);
if (res.isRight){
throw UnsupportedTypeException(
diff --git a/dart/packages/fory/lib/src/codegen/generate/builders.dart
b/dart/packages/fory/lib/src/codegen/generate/builders.dart
index 4eb00f98c..fc8b2a668 100644
--- a/dart/packages/fory/lib/src/codegen/generate/builders.dart
+++ b/dart/packages/fory/lib/src/codegen/generate/builders.dart
@@ -25,7 +25,7 @@ import 'obj_spec_generator.dart';
Builder foryObjSpecBuilder(BuilderOptions options) {
return SharedPartBuilder(
- [ObjSpecGenerator()], // 提供生成器
- ForyConst.intermediateMark, // 输出文件的名称
+ [ObjSpecGenerator()], // Provide a generator
+ ForyConst.intermediateMark, // Name of the output file
);
}
\ No newline at end of file
diff --git a/java/benchmark/analyze.py b/java/benchmark/analyze.py
index 6a29c522e..f030cf5c6 100644
--- a/java/benchmark/analyze.py
+++ b/java/benchmark/analyze.py
@@ -16,8 +16,9 @@
# under the License.
"""
- process fory/kryo/fst/hession performance data
+process fory/kryo/fst/hession performance data
"""
+
import datetime
import matplotlib.pyplot as plt
import os
@@ -132,9 +133,9 @@ def plot(df: pd.DataFrame, file_dir, filename,
column="Tps"):
fory_color = plot_color_map["Fory"]
plot_color_map["Fory"] = fory_metashared_color
plot_color_map["Forymetashared"] = fory_color
- ylable = column
+ ylabel = column
if column == "Tps":
- ylable = f"Tps/{scaler}"
+ ylabel = f"Tps/{scaler}"
data[column] = (data[column] / scaler).apply(format_scaler)
grouped = data.groupby(group_cols)
files_dict = {}
@@ -168,7 +169,7 @@ def plot(df: pd.DataFrame, file_dir, filename,
column="Tps"):
for container in ax.containers:
ax.bar_label(container)
ax.set_xlabel("enable_references")
- ax.set_ylabel(ylable)
+ ax.set_ylabel(ylabel)
libs = libs.str.replace("metashared", "meta\nshared")
ax.legend(libs, loc="upper right", prop={"size": 13})
save_dir = get_plot_dir(file_dir)
@@ -183,9 +184,9 @@ def plot_zero_copy(df: pd.DataFrame, file_dir, filename,
column="Tps"):
group_cols = ["Benchmark", "dataType", "bufferType"]
else:
group_cols = ["Benchmark", "bufferType"]
- ylable = column
+ ylabel = column
if column == "Tps":
- ylable = f"Tps/{scaler}"
+ ylabel = f"Tps/{scaler}"
data[column] = (data[column] / scaler).apply(format_scaler)
grouped = data.groupby(group_cols)
files_dict = {}
@@ -217,7 +218,7 @@ def plot_zero_copy(df: pd.DataFrame, file_dir, filename,
column="Tps"):
for container in ax.containers:
ax.bar_label(container)
ax.set_xlabel("array_size")
- ax.set_ylabel(ylable)
+ ax.set_ylabel(ylabel)
ax.legend(libs, bbox_to_anchor=(0.23, 0.99), prop={"size": 13})
save_dir = get_plot_dir(file_dir)
sub_plot.get_figure().savefig(save_dir + "/" + save_filename)
diff --git
a/java/benchmark/src/main/java/org/apache/fory/benchmark/util/MsgpackUtil.java
b/java/benchmark/src/main/java/org/apache/fory/benchmark/util/MsgpackUtil.java
index 9e3d98e5f..58e1e890e 100644
---
a/java/benchmark/src/main/java/org/apache/fory/benchmark/util/MsgpackUtil.java
+++
b/java/benchmark/src/main/java/org/apache/fory/benchmark/util/MsgpackUtil.java
@@ -119,7 +119,7 @@ public class MsgpackUtil {
}
private static void packMedia(MessagePacker messagePacker, Media media)
throws IOException {
- messagePacker.packMapHeader(9); // Media 对象的字段数
+ messagePacker.packMapHeader(9); // Media object's field count
messagePacker.packString("uri");
messagePacker.packString(media.uri);
@@ -302,7 +302,7 @@ public class MsgpackUtil {
private static void packSample(MessagePacker messagePacker, Sample sample)
throws IOException {
messagePacker.packMapHeader(23);
- // 基本类型
+ // Basic type
messagePacker.packString("intValue");
messagePacker.packInt(sample.intValue);
messagePacker.packString("longValue");
@@ -318,7 +318,7 @@ public class MsgpackUtil {
messagePacker.packString("booleanValue");
messagePacker.packBoolean(sample.booleanValue);
- // 包装类型
+ // Boxed type
messagePacker.packString("intValueBoxed");
if (sample.intValueBoxed != null)
messagePacker.packInt(sample.intValueBoxed);
else messagePacker.packNil();
@@ -348,7 +348,7 @@ public class MsgpackUtil {
if (sample.booleanValueBoxed != null)
messagePacker.packBoolean(sample.booleanValueBoxed);
else messagePacker.packNil();
- // 数组类型
+ // Array type
messagePacker.packString("intArray");
if (sample.intArray != null) {
messagePacker.packArrayHeader(sample.intArray.length);
diff --git a/python/pyfory/meta/metastring.py b/python/pyfory/meta/metastring.py
index ff739a49f..5fd306b74 100644
--- a/python/pyfory/meta/metastring.py
+++ b/python/pyfory/meta/metastring.py
@@ -305,8 +305,8 @@ class MetaStringEncoder:
Returns:
MetaString: An encoded MetaString object.
"""
- # Long meta string than _METASTRING_NUM_CHARS_LIMIT is not allowed.
- assert len(input_string) < _METASTRING_NUM_CHARS_LIMIT, "Long meta
string than _METASTRING_NUM_CHARS_LIMIT is not allowed."
+ # Long meta string longer than _METASTRING_NUM_CHARS_LIMIT is not
allowed.
+ assert len(input_string) < _METASTRING_NUM_CHARS_LIMIT, "Long meta
string longer than _METASTRING_NUM_CHARS_LIMIT is not allowed."
if not input_string:
return MetaString(
diff --git a/rust/fory-core/src/meta/string_util.rs
b/rust/fory-core/src/meta/string_util.rs
index bd65beff8..198e558da 100644
--- a/rust/fory-core/src/meta/string_util.rs
+++ b/rust/fory-core/src/meta/string_util.rs
@@ -137,7 +137,7 @@ pub fn is_latin(s: &str) -> bool {
#[cfg(test)]
mod tests {
- // 导入外部模块中的内容
+ // Import content from external modules
use super::*;
use rand::Rng;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]