[ https://issues.apache.org/jira/browse/STORM-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15257526#comment-15257526 ]
ASF GitHub Bot commented on STORM-1729: --------------------------------------- GitHub user HeartSaVioR opened a pull request: https://github.com/apache/storm/pull/1361 STORM-1729 Get rid of reflections while recording stats * define MultiCount/LatencyStatAndMetric in let statement and set type hint to there Before applying I got around 860,000 emitted/sec from BasicTopology, and after applying I got around 940,000~960,000 emitted/sec. And it removes reflection warnings from lines which record stats. Btw, though after applying this, `invokeMatchingMethod` is still on top 10. I'll track where it occurs. You can merge this pull request into a Git repository by running: $ git pull https://github.com/HeartSaVioR/storm STORM-1729-1.x-branch Alternatively you can review and apply these changes as the patch at: https://github.com/apache/storm/pull/1361.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 #1361 ---- commit ae78815e6ad27e2301d80c258f4ad535fa1193ff Author: Jungtaek Lim <kabh...@gmail.com> Date: 2016-04-26T03:53:38Z STORM-1729 Get rid of reflections while recording stats * define MultiCount/LatencyStatAndMetric in let statement and set type hint to there ---- > Get rid of reflections while recording stats > -------------------------------------------- > > Key: STORM-1729 > URL: https://issues.apache.org/jira/browse/STORM-1729 > Project: Apache Storm > Issue Type: Bug > Components: storm-core > Affects Versions: 1.0.0 > Reporter: Jungtaek Lim > Assignee: Jungtaek Lim > > I don't set affects version to 2.0.0 since it only occurs on Clojure. > {code} > (set! *warn-on-reflection* true) > (load-file "src/clj/org/apache/storm/stats.clj") > {code} > {quote} > Reflection warning, > /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:119:3 > - call to method incBy can't be resolved (target class is unknown). > Reflection warning, > /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:123:3 > - call to method incBy can't be resolved (target class is unknown). > Reflection warning, > /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:149:3 > - call to method incBy can't be resolved (target class is unknown). > Reflection warning, > /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:150:3 > - call to method record can't be resolved (target class is unknown). > Reflection warning, > /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:154:3 > - call to method incBy can't be resolved (target class is unknown). > {quote} > https://github.com/apache/storm/blob/1.x-branch/storm-core/src/clj/org/apache/storm/stats.clj#L119 > We expect there's no reflection since we give a type hint while calling, but > it doesn't work. > (I don't know why it doesn't work. Does generic type matter?) > Anyway, defining them into let makes them avoid reflection. > Even though we sample while recording stats, it does hurt performance with > fast & high-traffic components. -- This message was sent by Atlassian JIRA (v6.3.4#6332)