You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2018/06/20 19:39:00 UTC

[jira] [Created] (HADOOP-15551) Avoid use of Java8 streams in Configuration.addTags

Todd Lipcon created HADOOP-15551:
------------------------------------

             Summary: Avoid use of Java8 streams in Configuration.addTags
                 Key: HADOOP-15551
                 URL: https://issues.apache.org/jira/browse/HADOOP-15551
             Project: Hadoop Common
          Issue Type: Improvement
          Components: performance
    Affects Versions: 3.2
            Reporter: Todd Lipcon
            Assignee: Todd Lipcon


Configuration.addTags oddly uses Arrays.stream instead of a more conventional mechanism. When profiling a simple program that uses Configuration, I found that addTags was taking tens of millis of CPU to do very little work the first time it's called, accounting for ~8% of total profiler samples in my program.

{code}
[9] 4.52% 253 self: 0.00% 0 java/lang/invoke/MethodHandleNatives.linkCallSite
[9] 3.71% 208 self: 0.00% 0 java/lang/invoke/MethodHandleNatives.linkMethodHandleConstant
{code}

I don't know much about the implementation details of the Streams stuff, but it seems it's probably meant more for cases with very large arrays or somesuch. Switching to a normal Set.addAll() call eliminates this from the profile.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org