You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/04/30 17:15:00 UTC

[jira] [Commented] (GEODE-6704) AbstractRegion.allGatewaySenderIds can be improved

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

ASF subversion and git services commented on GEODE-6704:
--------------------------------------------------------

Commit f2710b1d4c468b7bc591b990f8ffbcb4f409c36b in geode's branch refs/heads/develop from Darrel Schneider
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=f2710b1 ]

GEODE-6704: optimize getAllGatewaySenderIds (#3518)

* added unit tests for AbstractRegion.getAllGatewaySenderIds

* optimized AbstractRegion.allGatewaySenderIds to do no object creations


> AbstractRegion.allGatewaySenderIds can be improved
> --------------------------------------------------
>
>                 Key: GEODE-6704
>                 URL: https://issues.apache.org/jira/browse/GEODE-6704
>             Project: Geode
>          Issue Type: Improvement
>          Components: core
>            Reporter: Darrel Schneider
>            Assignee: Darrel Schneider
>            Priority: Minor
>              Labels: performance
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Two things I noticed about AbstractRegion.allGatewaySenderIds that can be easily improved:
>  # It is currently implemented with CopyOnWriteArraySet but is never modified in place and is searched. These searches end up doing a linear search since the underlying impl is an ArrayList.
>  # The gettor method for allGatewaySenderIds always creates an unmodifiable wrapper. This is just garbage since the set is never modified. 
> A prototype fix is in: 9d978c615d4e6ccfc3d1ab731cf2e76bb59d1fec
> The settor method now uses a HashSet and makes sure that it is always wrapped in an unmodifiable wrapper. This allows the gettor to just return the reference.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)