Releases: karafka/karafka-core
Releases · karafka/karafka-core
v2.5.13
v2.5.12
v2.5.11
- [Enhancement] Specialize
Contract#digfor common 1-key and 2-key paths to avoid iterator overhead, yielding ~1.5x faster single-key lookups and ~1.45x faster two-key nested lookups. - [Enhancement] Replace
Node#build_accessors@local_defsArray with Hash for O(1) membership checks instead of O(n)Array#include?, yielding up to ~5x faster accessor lookups at 50 settings. - [Enhancement] Use frozen
EMPTY_ARRAYconstant forContract#calland#validate!defaultscopeparameter to avoid allocating a new Array on every invocation, yielding ~1.36x faster call dispatch and saving 1 Array allocation per call. - [Enhancement] Pre-resolve
@events_methods_mapmethod name before the listener notification loop inNotifications#instrumentto avoid repeated Hash lookup per listener, yielding ~1.12x faster event dispatch with multiple listeners. - [Enhancement] Cache a frozen success
Resultsingleton viaResult.successto eliminate 1 object allocation per successfulContract#callon the happy path. - [Enhancement] Skip nestings block re-evaluation in
Node#deep_dupto avoid recreating children that are immediately overwritten, yielding ~14x faster deep_dup and reducing allocations from ~620 to ~66 objects for large configs. - [Enhancement] Cache
CallbacksManager#callvalues snapshot and invalidate onadd/deleteto avoid allocating a new Array on every invocation while preserving thread-safety snapshot semantics, saving 1 Array allocation per call. - [Enhancement] Store execution time separately in
Eventand build the merged payload hash lazily on#payloadaccess, eliminating 1 Hash allocation perNotifications#instrumentcall when listeners use#[]access (the common pattern), yielding ~1.7x faster event dispatch. - [Enhancement] Replace
StatisticsDecorator#diffpending-writes buffer withkeys.eachdirect-write iteration, eliminating the buffer and write-back loop for ~13% faster decoration at scale (10 brokers, 20 topics, 2000 partitions). - [Enhancement] Reorder
StatisticsDecorator#difftype checks to testNumericbeforeHash, matching the ~80% numeric value distribution in librdkafka statistics. - [Enhancement] Support
only_keysoption inStatisticsDecoratorto decorate only specified numeric keys (e.g.consumer_lag,committed_offset). When combined withexcluded_keys, reduces decoration cost from ~80ms to ~8.5ms per call on large clusters (10 brokers, 20 topics, 2000 partitions) by using structure-aware navigation of the librdkafka statistics tree and direct key access instead of full-hash iteration.
v2.5.10
v2.5.9
- [Enhancement] Optimize
StatisticsDecoratorto eliminate per-hash Array allocations by usingeach_pairwith a per-call pending-writes buffer instead ofcurrent.keys.each, reducing allocations from tens of thousands to one per call at scale. - [Enhancement] Inline
StatisticsDecorator#appendand#suffix_keys_forinto#diffto reduce method call overhead by ~96% (from ~915k to ~39k calls at 6400 partitions). - [Enhancement] Support
excluded_keysoption inStatisticsDecoratorto skip decoration of unused librdkafka statistics subtrees (e.g. broker toppars, window stats), yielding ~28% additional speedup at scale.
v2.5.8
v2.5.7
- [Enhancement] Optimize
Node#deep_dupto reduce array allocations during configuration deep copying. - [Enhancement] Optimize
Result#initializeto use sharedEMPTY_HASHconstant for successful validations. - [Enhancement] Optimize
StatisticsDecorator#appendstring concatenation to reduce allocations. - [Enhancement] Optimize
Notifications#instrumentpayload handling to avoid unnecessary hash merges for empty payloads. - [Change] Remove Ruby 3.1 support due to EOL.