This is an archive of the discontinued LLVM Phabricator instance.

optimized xsgetn for better performance
ClosedPublic

Authored by laxmansole on Jun 7 2016, 3:04 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

laxmansole updated this revision to Diff 59960.Jun 7 2016, 3:04 PM
laxmansole retitled this revision from to optimized xsgetn for better performance.
laxmansole updated this object.
laxmansole added subscribers: llvm-commits, hiraditya, sebpop.
sebpop added a comment.Jun 7 2016, 4:28 PM

This is a performance related change: the copy function is translated into a memcpy that is more efficient than copying byte by byte.

mclow.lists edited edge metadata.Jun 7 2016, 10:48 PM

How much of a performance improvement is this?

This looks like a counterpart to http://reviews.llvm.org/rL229866, which did the same thing for xsputn.

This looks like a counterpart to http://reviews.llvm.org/rL229866, which did the same thing for xsputn.

Yes, they look similar. The idea is same to copy data in chunks whenever possible.

laxmansole updated this object.Jun 8 2016, 7:25 AM
laxmansole edited edge metadata.
sebpop added a comment.Jun 8 2016, 2:46 PM

How much of a performance improvement is this?

I have seen a reduction by several billion instructions when measuring with valgrind the perf of an application that uses streams to pipe data through.

Other than the min thing, this looks good to me.

libcxx/include/streambuf
502 ↗(On Diff #59960)

Please use _VSTD::min instead of std::min

laxmansole updated this revision to Diff 60222.Jun 9 2016, 12:13 PM
laxmansole marked an inline comment as done.Jun 9 2016, 12:20 PM
This revision was automatically updated to reflect the committed changes.