[ 
https://issues.apache.org/jira/browse/BEAM-940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16066504#comment-16066504
 ] 

Kenneth Knowles commented on BEAM-940:
--------------------------------------

Yes, you can get the {{OnTimerMethod}} by calling 
{{DoFnSignatures.getSignature(fn.getClass()).onTimerMethods().get(id)}}. And 
the signatures are cached so it should be fast to get it.

I think this should be correct for a cache key. But the {{OnTimerMethod}} has 
some extra things in it like {{Method}} and {{TypeDescriptor}} that will make 
the {{hashCode}} and {{equals}} a little bit slower.

I think the tuple could be called {{OnTimerMethodSpecifier}} and just have the 
class and id. But you could compare these approaches for performance. This area 
of code is a bit sensitive to small performance changes.

> ByteBuddyOnTimerInvokerFactory: key the cache with a (Class, id) tuple or 
> OnTimerMethod
> ---------------------------------------------------------------------------------------
>
>                 Key: BEAM-940
>                 URL: https://issues.apache.org/jira/browse/BEAM-940
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Kenneth Knowles
>            Assignee: Innocent
>            Priority: Trivial
>
> Right now it is a {{LoadingCache<Class, LoadingCache<id, OnTimerInvoker>>}}. 
> It is correct but just a bit less straightforward then we might like.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to