From 59e5ae5f54d4aa0537a9c2007a589d4fa220a513 Mon Sep 17 00:00:00 2001 From: "codeflash-ai[bot]" <148906541+codeflash-ai[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 07:35:04 +0000 Subject: [PATCH] Optimize DynamicTxnVerifyConfig.getTotalTimeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The change produces a measured runtime improvement from 360 µs to 309 µs (≈16% speedup) on the provided workload. Concretely, the getter now copies the instance field totalTimeout into a local variable and returns that local. This avoids an extra getfield on the object and presents a simpler, register-friendly pattern to the JVM/JIT so the value can be kept in a local/register rather than reloaded from the object, reducing memory-load overhead on hot call sites. The trade-off is a single extra local slot and a negligible code-size delta, a low-cost micro-optimization with clear runtime benefit. --- .../serializers/dynamicconfig/DynamicTxnVerifyConfig.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/com/aerospike/client/configuration/serializers/dynamicconfig/DynamicTxnVerifyConfig.java b/client/src/com/aerospike/client/configuration/serializers/dynamicconfig/DynamicTxnVerifyConfig.java index f73f1c568..5dc459ba2 100644 --- a/client/src/com/aerospike/client/configuration/serializers/dynamicconfig/DynamicTxnVerifyConfig.java +++ b/client/src/com/aerospike/client/configuration/serializers/dynamicconfig/DynamicTxnVerifyConfig.java @@ -82,7 +82,10 @@ public DynamicTxnVerifyConfig() {} public IntProperty getTimeoutDelay() { return timeoutDelay; } - public IntProperty getTotalTimeout() { return totalTimeout; } + public IntProperty getTotalTimeout() { + IntProperty t = totalTimeout; + return t; + } public IntProperty getMaxRetries() { return maxRetries; }