8000 Feature/upgrade protobuf by sunxien · Pull Request #5460 · alibaba/canal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature/upgrade protobuf #5460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sunxien
Copy link
Contributor
@sunxien sunxien commented May 25, 2025

升级 protobuf 版本,性能提升

sunxien added 4 commits May 20, 2025 00:08
- adapter 默认提供prometheus暴露JVM指标

- 指定 maven-antrun-plugin 未指定版本号,默认是 3.0.0,但是配置中使用 <tasks> 标签,编译报错。
   - 降级版本号,显式指定 1.8 版本
   - 或者把配置中的 <tasks> 标签改成 <target>
- 提升30%以上的性能
- 顺便解决protobuf历来版本的安全漏洞
- FastJSON2 内存保护机制,默认64MB,超过则抛出OutOfMemory异常
    - 见:JSONWriter.ensureCapacity
- String.format is lower than StringBuilder. Benchmark like below:

code snippet:

String str = String.format("%s-%s-%s", 0, 1, 10);

Benchmark                         Mode     Cnt         Score    Error  Units
StringBenchmark.append           thrpt          46431458.255           ops/s
StringBenchmark.format           thrpt            985724.313           ops/s
StringBenchmark.append            avgt                ≈ 10⁻⁸            s/op
StringBenchmark.format            avgt                ≈ 10⁻⁶            s/op
StringBenchmark.append          sample  364232        ≈ 10⁻⁷            s/op
StringBenchmark.append:p0.00    sample                ≈ 10⁻⁸            s/op
StringBenchmark.append:p0.50    sample                ≈ 10⁻⁷            s/op
StringBenchmark.append:p0.90    sample                ≈ 10⁻⁷            s/op
StringBenchmark.append:p0.95    sample                ≈ 10⁻⁷            s/op
StringBenchmark.append:p0.99    sample                ≈ 10⁻⁷            s/op
StringBenchmark.append:p0.999   sample                ≈ 10⁻⁷            s/op
StringBenchmark.append:p0.9999  sample                ≈ 10⁻⁵            s/op
StringBenchmark.append:p1.00    sample                 0.001            s/op
StringBenchmark.format          sample  336220        ≈ 10⁻⁶            s/op
StringBenchmark.format:p0.00    sample                ≈ 10⁻⁶            s/op
StringBenchmark.format:p0.50    sample                ≈ 10⁻⁶            s/op
StringBenchmark.format:p0.90    sample                ≈ 10⁻⁶            s/op
StringBenchmark.format:p0.95    sample                ≈ 10⁻⁶            s/op
StringBenchmark.format:p0.99    sample                ≈ 10⁻⁶            s/op
StringBenchmark.format:p0.999   sample                ≈ 10⁻⁵            s/op
StringBenchmark.format:p0.9999  sample                ≈ 10⁻⁴            s/op
StringBenchmark.format:p1.00    sample                 0.001            s/op
StringBenchmark.append              ss                ≈ 10⁻⁶            s/op
StringBenchmark.format              ss                ≈ 10⁻⁵            s/op
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.

1 participant
0