dcapwell commented on code in PR #4266:
URL: https://github.com/apache/cassandra/pull/4266#discussion_r2226048473


##########
src/java/org/apache/cassandra/service/accord/journal/AccordTopologyUpdate.java:
##########
@@ -129,8 +127,8 @@ public Journal.TopologyUpdate deserialize(DataInputPlus in) 
throws IOException
                 CommandStores.RangesForEpoch rangesForEpoch = 
RangesForEpochSerializer.instance.deserialize(in);
                 commandStores.put(commandStoreId, rangesForEpoch);
             }
-            Topology local = 
TopologySerializers.compactTopology.deserialize(in);
             Topology global = 
TopologySerializers.compactTopology.deserialize(in);
+            Topology local = global.forNode(AccordService.instance().nodeId());

Review Comment:
   spoke in slack and reviewed the code.  Both with and without `trim` produce 
the same results, but `trim` does a copy of the data which avoids the overhead 
that the view imposes (to find what to exclude).
   
   All code but 1 code path do `.trim` and that code path treats the `local` as 
a method local thing that gets iterated once, so the view is a better fit there.
   
   In this context, given that this is a reference held for a longer duration, 
the `trim` makes the access cheaper.
   
   Pushed this change out



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to