Improve slurp performance by using native Java StringWriter and jio/copy

Description

Instead of copying each character from InputReader to StringBuffer.

Performance improvement:

Approach: Use StringWriter and jio/copy vs character by character copy. Results from the current patch see a 4-5x perf boost after the jit warms up, with purely in-memory streams (ByteArrayInputStream over a 6MB string).

Patch: clj-668-2.patch
Screened by: Alex Miller

Environment

None

Attachments

2

Activity

Show:

Alex Miller October 9, 2015 at 2:23 PM

Updated patch to contain ticket id in commit description and provide a few more lines of diff context. No actual changes in the new patch, attribution retained.

Michael Blume September 4, 2015 at 2:30 AM

This is with an SSD, no idea what the numbers would look like with a spinny disk.

Michael Blume September 4, 2015 at 2:28 AM

Michael Blume September 4, 2015 at 2:19 AM

Michael Blume September 4, 2015 at 1:44 AM

Is this blocked on a new perf comparison? Should I post one?

Completed

Details

Assignee

Reporter

Approval

Patch

Priority

Affects versions

Fix versions

Created November 1, 2010 at 9:58 PM
Updated October 13, 2015 at 3:37 AM
Resolved October 13, 2015 at 3:37 AM