You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/06/09 11:21:18 UTC

[jira] [Commented] (SAMZA-1331) Optimize Snapshot class constructor

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

ASF GitHub Bot commented on SAMZA-1331:
---------------------------------------

GitHub user logarithm opened a pull request:

    https://github.com/apache/samza/pull/221

    SAMZA-1331: Optimize Snapshot class constructor

    In some of our workloads (where we need to gather samza metrics five times per minute) `SlidingTimeWindowReservoir.getSnapshot()` method takes up to 10% of processor time.
    
    Almost all of `getSnapshot` time is taken by Collections.sort method. So, the complexity of Snapshot constructor is O(NlogN) + iteration through passed values.
    
    This ticket asks to improve the performance of Snapshot constructor but keep the performance of all other methods at least on the same level.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/metamx/samza fix-snapshot

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/samza/pull/221.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #221
    
----
commit fc8b5fbc5fdc2145c62f0770c2b204a4dbfb1e57
Author: Maksim Logvinenko <ml...@gmail.com>
Date:   2017-06-07T20:53:47Z

    Remove Collections.sort in Snapshot. Added sum and average methods for O(1)

----


> Optimize Snapshot class constructor
> -----------------------------------
>
>                 Key: SAMZA-1331
>                 URL: https://issues.apache.org/jira/browse/SAMZA-1331
>             Project: Samza
>          Issue Type: Improvement
>            Reporter: Maksim Logvinenko
>            Assignee: Maksim Logvinenko
>
> In some of our workloads (where we need to gather samza metrics five times per minute) `SlidingTimeWindowReservoir.getSnapshot()` method takes up to 10% of processor time. 
> Almost all of `getSnapshot` time is taken by Collections.sort method. So, the complexity of Snapshot constructor is O(NlogN) + iteration through passed values.
> This ticket asks to improve the performance of Snapshot constructor but keep the performance of all other methods at least on the same level.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)