activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (ARTEMIS-1156) Long Autoboxing occurring on Hot Path
Date Thu, 11 May 2017 07:41:04 GMT


ASF GitHub Bot commented on ARTEMIS-1156:

Github user michaelandrepearce commented on the issue:
    So we have:
    1. primitive collections
    1. id's as objects (Long in this case)
    1. flywheel/interning caching pattern
    For 1:
     we have tried, looks good as long as we just do hot paths, can very quickly over complicate
our code, or start bringing negative effects.
    For 2:
    I haven't had a chance to see how much work, but this maybe simpler/cleaner imho. Though
does lend its self to people in future accidentally introducing the boxing issue again.
    For 3:
    Should work nicely, but only upto a predefined cache size. e.g. what occurs if cache size
is N and i end up with N+1000 longs, we end up in same position as with Long.valueOf. 
    Also some complexities introduced, how big should the cache be? how does someone tune
it, i run a very large vm, but fred runs a small one, this works for an app that you deploy
just in your own DC, but I'm weary of setting a magic cache size where it gets deployed in
many differing env's.
    For this reason, id personally favour looking into option 2, then keeping a low scoped
option 1.

> Long Autoboxing occurring on Hot Path
> -------------------------------------
>                 Key: ARTEMIS-1156
>                 URL:
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.0.0
>            Reporter: Michael Andre Pearce (IG)
>         Attachments: Screen Shot 2017-05-10 at 02.05.47.png
> JournalImpl is on the hot path, and whilst a lot of effort seems to have gone into ensuring
the use of primitives, unfortunately due to java collections used it is forcing long id's
to be auto boxed, this causes un-needed memory pressures. 

This message was sent by Atlassian JIRA

View raw message