Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0, 2.4.0, 2.5.0
-
Remove unnecessary synchronized blocks from Snappy/Zlib codecs.
Description
The current implementation of SnappyCompressor spends more time within the java loop of copying from the user buffer into the direct buffer allocated to the compressor impl, than the time it takes to compress the buffers.
The bottleneck was found to be java monitor code inside SnappyCompressor.
The methods are neatly inlined by the JIT into the parent caller (BlockCompressorStream::write), which unfortunately does not flatten out the synchronized blocks.
The loop does a write of small byte[] buffers (each IFile key+value).
I counted approximately 6 monitor enter/exit blocks per k-v pair written.
Attachments
Attachments
Issue Links
- is duplicated by
-
HADOOP-10116 fix "inconsistent synchronization" warnings in ZlibCompressor
- Resolved
- links to