tkalkirill commented on code in PR #1478:
URL: https://github.com/apache/ignite-3/pull/1478#discussion_r1058126669


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/storage/state/rocksdb/TxStateRocksDbStorage.java:
##########
@@ -57,6 +61,24 @@
  * Tx state storage implementation based on RocksDB.
  */
 public class TxStateRocksDbStorage implements TxStateStorage {
+    private static final VarHandle STATE;
+
+    private static final VarHandle REBALANCE_FUTURE;
+
+    static {
+        try {
+            STATE = 
MethodHandles.lookup().findVarHandle(TxStateRocksDbStorage.class, "state", 
StorageState.class);

Review Comment:
   Since there can be many partitions, we can, although a little, win in memory 
consumption for each using `VarHandle` instead of atomics. The less memory is 
used, the faster the GC runs, the faster the system runs.
   
   Yes, it looks like premature optimization, but I don't use complex 
constructs to make the code much more complicated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to