You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/11/18 12:51:42 UTC
[GitHub] [cassandra-accord] belliottsmith commented on pull request #15: Routables refactor
belliottsmith commented on PR #15:
URL: https://github.com/apache/cassandra-accord/pull/15#issuecomment-1319955179
One issue with this refactor is that it exposes us potentially quite extensively to the "type pollution" bug in the JVM whereby instanceof and checked casts may be costly.
Now, at the very least in C* this will be somewhat mitigated by having `RoutingKey` and `Key` split their hierarchy - though I believe we currently implement that with a shared interface as well, we can perhaps migrate to a shared abstract class.
But that still leaves 2-3 interfaces we may regularly perform checked-casts on, most notably as part of generic type parameters, e.g. in Sortables, Routables, Route, etc.
MOST of these locations SHOULD be eliminated by HotSpot, and I will take a look at some of the call-sites via print assembly. But we are unlikely to readily eliminate them all.
```
1: accord.impl.IntHashKey
Count: 426454
Types:
accord.primitives.SortableKey
accord.api.RoutingKey
accord.api.Key
accord.primitives.Routable
accord.primitives.Seekable
Traces:
accord.impl.IntHashKey.compareTo(IntHashKey.java:35)
class: accord.primitives.SortableKey
count: 156796
accord.primitives.KeyRoute.<init>(KeyRoute.java:17)
class: accord.api.RoutingKey
count: 118564
accord.impl.list.ListUpdate.slice(ListUpdate.java:57)
class: accord.api.Key
count: 38289
accord.local.Node.trySelectProgressKey(Node.java:440)
class: accord.primitives.Routable
count: 34471
accord.primitives.Deps.slice(Deps.java:466)
class: accord.api.Key
count: 29730
accord.impl.list.ListUpdate.slice(ListUpdate.java:56)
class: accord.primitives.SortableKey
count: 13098
accord.primitives.Range$EndInclusive.compareTo(Range.java:36)
class: accord.primitives.SortableKey
count: 11565
accord.primitives.Deps.toRoutables(Deps.java:1001)
class: accord.api.Key
count: 6177
accord.impl.list.ListQuery.compute(ListQuery.java:50)
class: accord.api.Key
count: 4598
accord.burn.BurnTest.randomKey(BurnTest.java:108)
class: accord.api.Key
count: 3000
accord.burn.BurnTest.lambda$burn$3(BurnTest.java:218)
class: accord.api.Key
count: 2238
accord.local.CommandStore.hashIntersects(CommandStore.java:100)
class: accord.primitives.SortableKey
count: 1987
accord.burn.BurnTest.generate(BurnTest.java:92)
class: accord.api.Key
count: 1929
accord.impl.list.ListUpdate.apply(ListUpdate.java:46)
class: accord.api.Key
count: 1877
accord.local.Node.trySelectHomeKey(Node.java:401)
class: accord.primitives.Seekable
count: 1645
accord.impl.InMemoryCommandStore$State.lambda$commandsForKey$1(InMemoryCommandStore.java:102)
class: accord.api.Key
count: 458
accord.coordinate.Invalidate.invalidate(Invalidate.java:167)
class: accord.primitives.Routable
count: 18
accord.impl.SimpleProgressLog$BlockingState.invalidate(SimpleProgressLog.java:477)
class: accord.primitives.Routable
count: 14
```
--
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: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org