- [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.
- [Enhancement] Introduce
MinitestLocatorhelper for minitest/spec subject class auto-discovery from test file paths.
- [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.
- [Enhancement] Memoize
StatisticsDecoratorsuffix keys to reduce string allocations (#268).
- [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. - [EOL] Remove Ruby 3.1 support due to EOL.
- [Change] Normalize how libs and dependencies are required (no functional change for the end user)
- [Change] Set minimum
karafka-rdkafkaon0.20.0to support new features and allow for open range as bothwaterdropandkarafkamanage this.
- [Enhancement] Remove reliance on
Setclass.
- [Fix] Fix old regression on misbehaviour when Object methods are overwritten.
- [Enhancement] Optimize code to mitigate the Ruby performance warning from
Karafka::Core::Configurable::Node(#208) - [Enhancement] Raise errors on detected Ruby warnings.
- [Change] Remove unused Ruby 2.7 code.
- [Change] Remove
funding_urifrom the gemspec to minimize double-funding info.
- [Enhancement] Support
#unsubscribe. - [Enhancement] Allow for providing a root scope path for error keys.
- [Fix] Fix a bug where on no errors the result would be an array instead of a hash.
- [Fix] Fix spec hanging when Kafka cluster on 9092 is running.
- [Change] Move to trusted-publishers and remove signing since no longer needed.
- [Change] Set minimum
karafka-rdkafkaon0.19.2to support new features.
- [Enhancement] Rename internal node
#namemethod to#node_nameso we can use#nameas the attribute name.
- [Fix] Relax lock on
karafka-rdkafka
- [Enhancement] Remove
RspecLocatordependency onactivesupport.
- [Maintenance] Declare
loggeras a dependency.
- [Fix] Make sure that
karafka-coreworks with older versions ofkarafka-rdkafkathat do not support macos fork mitigation.
- [Enhancement] Mitigate macos forking issues when librdkafka is not loaded to memory.
- [Change] Allow
karafka-rdkafka0.18.0.
- [EOL] Drop Ruby
3.0support according to the EOL schedule. - [Enhancement] Support listeners inspection via
#listeners. - [Fix] Restore
#available_eventsnotifications bus method. - [Change] Set minimum
karafka-rdkafkaon0.17.6to support new features.
- [Change] Set minimum
karafka-rdkafkaon0.16.0to support new features and allow for0.17.0.
- [Fix] Use
Objectinstead ofBasicObjectfor rule result comparison because of Time mismatch with BasicObject.
- [Enhancement] Allow
karafka-rdkafka0.16.xto be used since API compatible.
- [Enhancement] Provide fast-track for events without subscriptions to save on allocations.
- [Enhancement] Save memory allocation on each contract rule validation execution.
- [Enhancement] Save one allocation per
float_now+ 2-3x performance by using the Posix clock instead ofTime.now.utc.to_f. - [Enhancement] Use direct
float_millisecondprecision inmonotonic_nownot to multiply by 1000 (allocations and CPU savings). - [Enhancement] Save one array allocation on one instrumentation.
- [Enhancement] Allow clearing one event type (dorner).
- [EOL] Drop Ruby
2.7support. - [Enhancement] Provide necessary alterations for custom oauth token callbacks to operate.
- [Change] Set minimum
karafka-rdkafkaon0.15.0to support new features.
- [Change] Set minimum
karafka-rdkafkaon0.14.8to support new features. - [Change] Remove
concurrent-rubyusage.
- [Change] Set minimum
karafka-rdkafkaon0.13.9to support alternative consumer builder.
- [Enhancement] Set backtrace for errors propagated via the errors callbacks.
- [EOL] Drop support for Ruby 2.6 due to incompatibilities in usage of
ObjectSpace::WeakMap - [Change] Set minimum
karafka-rdkafkaon0.13.8to support consumer#position.
- [Enhancement] Allow for
lazyevaluated constructors. - [Enhancement] Allow no-arg constructors.
- [Change] Set minimum
karafka-rdkafkaon0.13.6.
- [Fix] Reuse previous frozen duration as a base for incoming computation.
- Optimize statistics decorator by minimizing number of new objects created.
- Expand the decoration to include new value
_fdproviding freeze duration in milliseconds. This value informs us for how many consecutive ms the given value did not change. It can be useful for detecting values that should change once in a while but are stale.
- [Maintenance] Update the signing cert (old expired)
- [Change] Set minimum
karafka-rdkafkaon0.13.1.
- [Change] Set
karafka-rdkafkarequirement from>= 0.13.0to<= 0.14.0. - [Change] Remove no longer needed patch.
- Set minimum
karafka-rdkafkaon0.12.3.
- Introduce ability to tag certain objects by including the
Karafka::Core::Taggablemodule.
- Set minimum
karafka-rdkafkaon0.12.1.
- Move
RspecLocatorto core.
- Use
karafka-rdkafkainstead ofrdkafka. This change is needed to ensure that all consecutive releases are stable and compatible. - Relax Ruby requirement to
2.6. It does not mean we officially support it but it may work. Go to Versions Lifecycle and EOL for more details.
- Add
Karafka::Core::Helpers::Timeutility for time reporting.
- Allow for recompilation of config upon injecting new config nodes.
- Compile given config scope automatically after it is defined.
- Support sub-config merging via their nested definitions.
- Reverse node compilation state tracking removal.
- Move
librdkafkageneric (producer and consumer) patches from WaterDrop here. - Move dependency on
librdkafkahere from both Karafka and WaterDrop to unify management. - Move
CallbacksManagerfrom WaterDrop because it's shared.
- Disallow publishing events that were not registered.
- Fix a potential race condition when adding listeners concurrently from multiple threads.
- Maintenance release. Cert chain update. No code changes.
- Add extracted statistics decorator (#932)
- Fix a case where setting would match a method monkey-patched on an object (#1) causing initializers not to build proper accessors on nodes. This is not the core bug, but still worth handling this case.
- Initial extraction of common components used in the Karafka ecosystem from WaterDrop.