summaryrefslogtreecommitdiff
path: root/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-04-11 17:55:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-11 17:55:00 +0000
commit7b77dfc9aafb423e6204dd5433699cfd787147b3 (patch)
treefd8e728f993718385e1fc1d33942577bf1c4c1a2 /fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp
parent63c5fa9cf2250dcd91dd88d8233c0d9d93b1d917 (diff)
downloadpdfium-7b77dfc9aafb423e6204dd5433699cfd787147b3.tar.xz
Reserve space to reduce memory operations while encoding barcode
In the test case from the bug, the majority of the time is being spent resizing Widestring internal buffers, since += is being called in a tight loop. Since the size of the input being mutated and stored is known, this CL reserves the space before hand to lower thrashing. This substantially improves runtime of this test case locally. BUG=chromium:802242 Change-Id: I5176dabc94634b4d6bc3e9425fe6469a5bf35a41 Reviewed-on: https://pdfium-review.googlesource.com/30190 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp')
0 files changed, 0 insertions, 0 deletions