[
https://issues.apache.org/jira/browse/HADOOP-8926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13478329#comment-13478329
]
Tsz Wo (Nicholas), SZE commented on HADOOP-8926:
------------------------------------------------
Gopal, Amazing works! There are 10% or more performance improvement from your
patch.
java.version = 1.6.0_35
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.6.0_35-b10-428-11M3811
java.vm.version = 20.10-b01-428
java.vm.vendor = Apple Inc.
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.version = 1.0
java.specification.version = 1.6
os.arch = x86_64
os.name = Mac OS X
os.version = 10.7.4
Performance Table (The unit is MB/sec)
|| Num Bytes || CRC32 || PureJavaCrc32_8926 || PureJavaCrc32 ||
| 1 | 11.896 | 129.832 | 164.845 |
| 2 | 24.097 | 192.742 | 210.266 |
| 4 | 46.274 | 222.059 | 233.902 |
| 8 | 82.332 | 488.716 | 438.514 |
| 16 | 131.682 | 587.312 | 602.784 |
| 32 | 187.265 | 796.510 | 760.628 |
| 64 | 237.088 | 938.650 | 891.017 |
| 128 | 264.795 | 1049.774 | 913.666 |
| 256 | 291.785 | 1095.084 | 987.380 |
| 512 | 298.590 | 1126.067 | 1002.899 |
| 1024 | 305.349 | 1152.375 | 1040.211 |
| 2048 | 309.342 | 1119.713 | 1033.258 |
| 4096 | 309.162 | 1170.767 | 1047.746 |
| 8192 | 321.775 | 1189.724 | 1053.065 |
| 16384 | 320.457 | 1181.128 | 1060.138 |
| 32768 | 324.524 | 1169.965 | 1050.610 |
| 65536 | 322.380 | 1160.471 | 1053.854 |
| 131072 | 315.983 | 1138.223 | 1009.193 |
| 262144 | 324.293 | 1190.476 | 1020.782 |
| 524288 | 316.003 | 1136.979 | 1015.389 |
| 1048576 | 321.715 | 1081.465 | 1033.750 |
| 2097152 | 318.330 | 1189.680 | 1072.054 |
| 4194304 | 316.710 | 1138.496 | 1024.352 |
| 8388608 | 315.701 | 1124.909 | 1030.505 |
| 16777216 | 325.575 | 1154.724 | 1031.285 |
> hadoop.util.PureJavaCrc32 cache hit-ratio is low for static data
> ----------------------------------------------------------------
>
> Key: HADOOP-8926
> URL: https://issues.apache.org/jira/browse/HADOOP-8926
> Project: Hadoop Common
> Issue Type: Improvement
> Components: util
> Affects Versions: 2.0.3-alpha
> Environment: Ubuntu 10.10 i386
> Reporter: Gopal V
> Assignee: Gopal V
> Priority: Trivial
> Labels: optimization
> Fix For: 3.0.0, 2.0.3-alpha
>
> Attachments: crc32-faster+readable.patch, crc32-faster+test.patch,
> pure-crc32-cache-hit.patch
>
>
> While running microbenchmarks for HDFS write codepath, a significant part of
> the CPU fraction was consumed by the DataChecksum.update().
> The attached patch converts the static arrays in CRC32 into a single linear
> array for a performance boost in the inner loop.
> milli-seconds for 1Gig (16400 loop over a 64kb chunk)
> || platform || original || cache-aware || improvement ||
> | x86 | 3894 | 2304 | 40.83 |
> | x86_64 | 2131 | 1826 | 14 |
> The performance improvement on x86 is rather larger than the 64bit case, due
> to the extra register/stack pressure caused by the static arrays.
> A closer analysis of the PureJavaCrc32 JIT code shows the following assembly
> fragment
> {code}
> 0x40f1e345: mov $0x184,%ecx
> 0x40f1e34a: mov 0x4415b560(%ecx),%ecx ;*getstatic T8_5
> ; - PureJavaCrc32::update@95 (line 61)
> ; {oop('PureJavaCrc32')}
> 0x40f1e350: mov %ecx,0x2c(%esp)
> {code}
> Basically, the static variables T8_0 through to T8_7 are being spilled to the
> stack because of register pressure. The x86_64 case has a lower likelihood of
> such pessimistic JIT code due to the increased number of registers.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira