Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does:
When a user implements custom POJOs and uses non-pointer POJOs to encode, the encoding fails to transfer pojos forcibly. As a result, the program execution fails to meet expectations
When non-pointer structures are encoded, they are uniformly converted to Pointers for encoding
、
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Benchmark: 分别在struct以及pointer场景下 用串行以及8c并行 对当前pr与master进行对比。
// Benchmark_Struct_Encode 2231869 506.8 ns/op 560 B/op 7 allocs/op
// Benchmark_Struct_Encode-master 713761 1549 ns/op 560 B/op 8 allocs/op
// Benchmark_Pointer_Encode 2565778 476.1 ns/op 560 B/op 7 allocs/op
// Benchmark_Pointer_Encode-master 2328867 511.4 ns/op 576 B/op 8 allocs/op
// Benchmark_Struct_Encode_8 2307214 519.4 ns/op 560 B/op 7 allocs/op
// Benchmark_Struct_Encode_8-master 3104438 387.6 ns/op 560 B/op 8 allocs/op
// Benchmark_Pointer_Encode_8 2460842 476.7 ns/op 560 B/op 7 allocs/op
// Benchmark_Pointer_Encode_8-master 2254734 514.9 ns/op 576 B/op 8 allocs/op
当前master 对于struct 是非指针并且receiver是指针的情况下 性能和当前pr差距较大,其他的情况差距都还好。