Kitex Release v0.10.0
Projects:
Introduction to Key Changes
Performance Optimization
- Long connection: conncurrency = 100, qps increased by 4%, p99 decreased by 18%
- connection multiplexing: conncurrency = 100, qps increased by 7%, p99 decreased by 24%
- gRPC: conncurrency = 100, qps increased by 8%,p99 decreased by 10%
Code Generation Simplification and Optimization
- Remove non-serialization code (By default): the original kitex_gen Thrift code includes Processor code to maintain consistency with Apache Thrift. However, Kitex does not need these codes. To solve users' code generation painpoint, this version Kitex removes this part of the code, increasing the generation speed by about 10%.
- Remove Apache Codec code (Remove if configured):Kitex has custom FastCodec code, and the original Apache Codec is only required when using Buffered protocol. The new version of Kitex implements SkipDecoder. If enabled, the serialization will be completely independent of Apache Codec, reducing the generated code size by about 50%. Refer to this doc for usage SkipDecoder
New Feature
- Thrift Serialize Data Ondemands:Support defining FieldMask to achieve on-demand serialization of data (field clipping, merging, RPC Performance optimization, etc.), see details Thrift FieldMask RFC
Feature optimization
- CircuitBreaker: Support for customized circuit breaker error types.
- Failure Retry:The code configuration of the customized result retry adds the ctx parameter to facilitate users to check whether to retry based on ctx information.
- Remove cache from consistent hashing:Solve the issue of high latency and memory increase caused by scattered hash keys. After removing the cache, it can effectively reduce memory usage and cache management consumption in scenarios where keys are particularly scattered or even close to random distribution.
User Experience and Tool Optimization
- Kitex tool compatibility check:Optimize the “undefined” compile error caused by introducing new definitions in old generated code. The Kitex tool will check the Kitex version used in go.mod before generating code. If the Kitex tool and Kitex version are incompatible, the code will not be generated and will provide corresponding upgrade and downgrade prompts and documentation.
Full Release Log
Feature:
- [#1370] feat(loadbalance): do not cache all the keys for Consistent Hash
- [#1359] feat:(generic) jsonpb using dynamicgo support parse IDL from memory
- [#1353] feat(retry): add ctx param for customized result retry funcs
- [#1352] feat: add option to specify ip version for default HTTPResolver
- [#1316] feat(kitex tool): support dependencies compatibility checking
- [#1346] feat(generic): set dynamicgo parse mode
- [#1336] feat(tool): fast-codec supports Thrift Fieldmask
- [#1313, #1378] feat(thrift codec): implement skipDecoder to enable Frugal and FastCodec for standard Thrift Buffer Protocol
- [#1257] feat: CBSuite custom GetErrorType func
Optimize:
- [#1349] optimize(gRPC): gRPC onError uses CtxErrorf to print log with information in ctx
- [#1326] optimize(tool): remove thrift processor for less codegen
Perf:
- [#1369] perf(thrift): optimized skip decoder
- [#1314] perf: use dirtmake to reduce memclr cost
- [#1322] perf(codec): support fast write nocopy when using netpoll link buffer
- [#1276] perf: linear allocator for fast codec ReadString/ReadBinary
- [#1320] perf(codec): fast codec use batch alloc
Fix:
- [#1379] fix: fix a bug “unknown service xxx” when using generic client by not writing IDLServiceName when it’s generic service
- [#1368] fix(remote): modify the error message thrown when no target service is found
- [#1374] fix: init default values when using liner allocator
- [#1361] fix: span cache re-cap bytes when using Make
- [#1362] fix(payloadCodec): replace the registered PayloadCodec if the type is same when using WithPayloadCodec for server-side
- [#1364] fix: fix grpc compressor mcache free panic when data is empty
- [#1328] fix(gRPC): release connection in DoFinish for grpc streaming to close the short connection
- [#1307] fix(connpool): kitex long pool reset idleList element to nil to prevent conn leak
- [#1294] fix(netpollmux): fix a bug that disables multi-service by assigning the first svcInfo to targetSvcInfo
- [#1308] fix(generic): not write generic method name for binary generic exception to align with method names of services not using binary generic
Refactor:
- [#1344] refactor(tool): export thriftgo template definition in kitextool
Chore:
- [#1385] chore: update dynamicgo to v0.2.8
- [#1383] chore: upgrade netpoll to v0.6.1
- [#1376] chore: integration test use go 1.20 to solve the compatibility issue of official gRPC in kitex-tests repo
- [#1355] chore: upgrade netpoll to v0.6.1 pre-release version
- [#1338] chore: correct the comment of FreezeRPCInfo
- [#1347] chore: use runtimex to replace choleraehyq/pid
- [#1342] chore: update sonic/loader to v0.1.1
- [#1334] chore: update dynamicgo to v0.2.3
- [#1324] chore: update dynamicgo and sonic version
- [#1317] chore: frugal v0.1.15 (with migrated iasm)
Thanks a lot to those community contributors who submit some pull requests or share your ideas for this version: @XiaoYi-byte