[jira] [Comment Edited] (HDFS-13168) XmlImageVisitor - Prefer Array over LinkedList

2018-02-20 Thread JIRA

[ 
https://issues.apache.org/jira/browse/HDFS-13168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16370367#comment-16370367
 ] 

Íñigo Goiri edited comment on HDFS-13168 at 2/20/18 6:02 PM:
-

{{StringBuilder}} is more optimal but I'm not sure how does + in {{String}} is 
implemented.
Anyway, just philosophical at this point, it should be good either way.
I'm committing [^HDFS-13168.2.patch] to {{trunk}}; [~belugabehr], for the 
commit message do I use your name capitalized as it is here or do you prefer 
some other spelling?



was (Author: elgoiri):
{{StringBuilder}} is more optimal but I'm not sure how does + in {{String}} is 
implemented.
Anyway, just philosophical at this point, it should be good either way.
I'm committing [^HDFS-13168.2.patch] to {{trunk}}; [~belugabehr], for the 
commit message do I use for your name capitalized as it is here or do you 
prefer some other spelling?


> XmlImageVisitor - Prefer Array over LinkedList
> --
>
> Key: HDFS-13168
> URL: https://issues.apache.org/jira/browse/HDFS-13168
> Project: Hadoop HDFS
>  Issue Type: Improvement
>  Components: hdfs
>Affects Versions: 3.0.0
>Reporter: BELUGA BEHR
>Assignee: BELUGA BEHR
>Priority: Minor
> Attachments: HDFS-13168.1.patch, HDFS-13168.2.patch
>
>
> {{ArrayDeque}}
> {quote}This class is likely to be faster than Stack when used as a stack, and 
> faster than LinkedList when used as a queue.{quote}
> .. not to mention less memory fragmentation (single backing array v.s. many 
> ArrayList nodes).
> https://docs.oracle.com/javase/8/docs/api/java/util/ArrayDeque.html



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Comment Edited] (HDFS-13168) XmlImageVisitor - Prefer Array over LinkedList

2018-02-19 Thread BELUGA BEHR (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-13168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16369368#comment-16369368
 ] 

BELUGA BEHR edited comment on HDFS-13168 at 2/19/18 5:50 PM:
-

Tested a 4K FSImage file
{code:java}
## Current Implementation

Result "org.apache.hadoop.hdfs.tools.offlineImageViewer.TestSpeed.testSpeed":
  1737.194 ±(99.9%) 19.775 ops/s [Average]
  (min, avg, max) = (1533.113, 1737.194, 1967.332), stdev = 83.729
  CI (99.9%): [1717.419, 1756.969] (assumes normal distribution)


# Run complete. Total time: 00:06:45

BenchmarkMode  Cnt ScoreError  Units
offlineImageViewer.TestSpeed.testSpeed  thrpt  200  1737.194 ± 19.775  ops/s


## Patch Impelementation

Result "org.apache.hadoop.hdfs.tools.offlineImageViewer.TestSpeed.testSpeed":
  1781.301 ±(99.9%) 21.108 ops/s [Average]
  (min, avg, max) = (1407.945, 1781.301, 2020.971), stdev = 89.372
  CI (99.9%): [1760.193, 1802.409] (assumes normal distribution)


# Run complete. Total time: 00:06:45

BenchmarkMode  Cnt ScoreError  Units
offlineImageViewer.TestSpeed.testSpeed  thrpt  200  1781.301 ± 21.108  ops/s
{code}
... and memory fragmentation is not really counted here of the {{LinkedList}} 
because of large heap size


was (Author: belugabehr):
{code}
## Current Implementation

Result "org.apache.hadoop.hdfs.tools.offlineImageViewer.TestSpeed.testSpeed":
  1737.194 ±(99.9%) 19.775 ops/s [Average]
  (min, avg, max) = (1533.113, 1737.194, 1967.332), stdev = 83.729
  CI (99.9%): [1717.419, 1756.969] (assumes normal distribution)


# Run complete. Total time: 00:06:45

BenchmarkMode  Cnt ScoreError  Units
offlineImageViewer.TestSpeed.testSpeed  thrpt  200  1737.194 ± 19.775  ops/s


## Patch Impelementation

Result "org.apache.hadoop.hdfs.tools.offlineImageViewer.TestSpeed.testSpeed":
  1781.301 ±(99.9%) 21.108 ops/s [Average]
  (min, avg, max) = (1407.945, 1781.301, 2020.971), stdev = 89.372
  CI (99.9%): [1760.193, 1802.409] (assumes normal distribution)


# Run complete. Total time: 00:06:45

BenchmarkMode  Cnt ScoreError  Units
offlineImageViewer.TestSpeed.testSpeed  thrpt  200  1781.301 ± 21.108  ops/s
{code}

... and memory fragmentation is not really counted here of the {{LinkedList}} 
because of large heap size

> XmlImageVisitor - Prefer Array over LinkedList
> --
>
> Key: HDFS-13168
> URL: https://issues.apache.org/jira/browse/HDFS-13168
> Project: Hadoop HDFS
>  Issue Type: Improvement
>  Components: hdfs
>Affects Versions: 3.0.0
>Reporter: BELUGA BEHR
>Priority: Minor
> Attachments: HDFS-13168.1.patch, HDFS-13168.2.patch
>
>
> {{ArrayDeque}}
> {quote}This class is likely to be faster than Stack when used as a stack, and 
> faster than LinkedList when used as a queue.{quote}
> .. not to mention less memory fragmentation (single backing array v.s. many 
> ArrayList nodes).
> https://docs.oracle.com/javase/8/docs/api/java/util/ArrayDeque.html



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org



[jira] [Comment Edited] (HDFS-13168) XmlImageVisitor - Prefer Array over LinkedList

2018-02-18 Thread JIRA

[ 
https://issues.apache.org/jira/browse/HDFS-13168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16368685#comment-16368685
 ] 

Íñigo Goiri edited comment on HDFS-13168 at 2/18/18 10:02 PM:
--

[~belugabehr], do you have any approximate performance improvements after using 
{{ArrayDequeue}}?
I would go for it anyway but just for completeness.

A minor comment on  [^HDFS-13168.1.patch], we could use the implicit type and 
do {{new ArrayDeque<>();}}.
The failed unit tests seem unrelated to me.
The related test would be {{TestCheckpoint}} and it seems to 
[pass|https://builds.apache.org/job/PreCommit-HDFS-Build/23114/testReport/org.apache.hadoop.hdfs.server.namenode/TestCheckpoint/];
 not sure it tests much though.


was (Author: elgoiri):
[~belugabehr], do you have any approximate performance improvements after using 
{{ArrayDequeue}}?
I would go for it anyway but just for completeness.

A minor comment on  [^HDFS-13168.1.patch], we could use the implicit type and 
do {{new ArrayDeque<>();}}.
The unit tests seem unrelated to me.
The related test would be {{TestCheckpoint}} and it seems to 
[pass|https://builds.apache.org/job/PreCommit-HDFS-Build/23114/testReport/org.apache.hadoop.hdfs.server.namenode/TestCheckpoint/];
 not sure it tests much though.

> XmlImageVisitor - Prefer Array over LinkedList
> --
>
> Key: HDFS-13168
> URL: https://issues.apache.org/jira/browse/HDFS-13168
> Project: Hadoop HDFS
>  Issue Type: Improvement
>  Components: hdfs
>Affects Versions: 3.0.0
>Reporter: BELUGA BEHR
>Priority: Minor
> Attachments: HDFS-13168.1.patch
>
>
> {{ArrayDeque}}
> {quote}This class is likely to be faster than Stack when used as a stack, and 
> faster than LinkedList when used as a queue.{quote}
> .. not to mention less memory fragmentation (single backing array v.s. many 
> ArrayList nodes).
> https://docs.oracle.com/javase/8/docs/api/java/util/ArrayDeque.html



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

-
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org