Skip to content
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

perf: linear allocator for ReadString/ReadBinary #23

Merged
merged 2 commits into from
Jun 3, 2024
Merged

Conversation

ppzqh
Copy link
Contributor

@ppzqh ppzqh commented Jun 3, 2024

What type of PR is this?

perf

What this PR does / why we need it (en: English/zh: Chinese):

en:
zh: 使用线性分配器减少 malloc 次数,优化 ReadString/ReadBinary

Benchmark

// new
BenchmarkMain/Benchmark_unmarshal_string_fastpb
BenchmarkMain/Benchmark_unmarshal_string_fastpb-12         	11505452	        97.10 ns/op	    2128 B/op	       1 allocs/op

// old
BenchmarkMain/Benchmark_unmarshal_string_fastpb
BenchmarkMain/Benchmark_unmarshal_string_fastpb-12         	 8002330	       144.8 ns/op	    2128 B/op	       3 allocs/op

Which issue(s) this PR fixes:

@ppzqh ppzqh requested review from a team as code owners June 3, 2024 03:04
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 56 files.

Valid Invalid Ignored Fixed
1 16 39 0
Click to see the invalid file list
  • benchmark/benchmark.go
  • benchmark/benchmark_fastpb.go
  • benchmark/benchmark_fastpb_test.go
  • benchmark/benchmark_gogo.go
  • benchmark/benchmark_gogo_test.go
  • benchmark/benchmark_golang.go
  • benchmark/benchmark_golang_test.go
  • benchmark/benchmark_test.go
  • examples/demo.go
  • fastpb.go
  • fastpb_impl.go
  • fastpb_impl_test.go
  • protoc-gen-fastpb/generator/generator.go
  • protoc-gen-fastpb/main.go
  • version.go
  • wire_test.go
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 56 files.

Valid Invalid Ignored Fixed
1 16 39 0
Click to see the invalid file list
  • benchmark/benchmark.go
  • benchmark/benchmark_fastpb.go
  • benchmark/benchmark_fastpb_test.go
  • benchmark/benchmark_gogo.go
  • benchmark/benchmark_gogo_test.go
  • benchmark/benchmark_golang.go
  • benchmark/benchmark_golang_test.go
  • benchmark/benchmark_test.go
  • examples/demo.go
  • fastpb.go
  • fastpb_impl.go
  • fastpb_impl_test.go
  • protoc-gen-fastpb/generator/generator.go
  • protoc-gen-fastpb/main.go
  • version.go
  • wire_test.go
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

HeyJavaBean
HeyJavaBean previously approved these changes Jun 3, 2024
@ppzqh ppzqh enabled auto-merge (squash) June 3, 2024 09:22
@ppzqh ppzqh merged commit dda1854 into main Jun 3, 2024
7 checks passed
@ppzqh ppzqh deleted the perf/span_cache branch June 3, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants