Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Issue 3471006: AU: Speed up updates by using buffered writes. (Closed)

Created:
10 years, 3 months ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, petkov, adlr, sosa, kmixter1
Visibility:
Public.

Description

AU: Speed up updates by using buffered writes. Given that SSD writes are really slow, this improves performance significantly. This reduces update time on AGZ from 375 to 100 seconds. BUG=6901 TEST=unit tests, gmerged on device and measured speed Change-Id: Idac7743f6eaa8f26878a2d1f6b9401513e2ca600 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=e971f33

Patch Set 1 #

Total comments: 1

Patch Set 2 : switch to a BufferedFileWriter #

Total comments: 2

Patch Set 3 : don't send empty buffers to the next FileWriter #

Patch Set 4 : update comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+287 lines, -6 lines) Patch
M SConstruct View 2 chunks +2 lines, -0 lines 0 comments Download
A buffered_file_writer.h View 2 3 1 chunk +53 lines, -0 lines 0 comments Download
A buffered_file_writer.cc View 2 1 chunk +60 lines, -0 lines 0 comments Download
A buffered_file_writer_unittest.cc View 2 1 chunk +132 lines, -0 lines 0 comments Download
M download_action.h View 2 chunks +4 lines, -2 lines 0 comments Download
M download_action.cc View 2 chunks +12 lines, -2 lines 0 comments Download
M file_writer.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
A file_writer_mock.h View 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
petkov
10 years, 3 months ago (2010-09-21 23:02:10 UTC) #1
adlr
can you add a TODO to split DirectFileWriter into a BufferedFileWriter and old fasioned DirectFileWriter? ...
10 years, 3 months ago (2010-09-22 20:44:52 UTC) #2
petkov
Switched to BufferedFileWriter and added separate unit tests. PTAL
10 years, 3 months ago (2010-09-22 23:07:27 UTC) #3
adlr
LGTM w/ nits thanks! http://codereview.chromium.org/3471006/diff/5001/6002 File buffered_file_writer.cc (right): http://codereview.chromium.org/3471006/diff/5001/6002#newcode47 buffered_file_writer.cc:47: ssize_t rc_write = WriteBuffer(); it's ...
10 years, 3 months ago (2010-09-22 23:32:44 UTC) #4
petkov
10 years, 3 months ago (2010-09-22 23:50:43 UTC) #5
Empty buffers are not sent to the next FileWriter any more. Added appropriate
unit tests.

Pushing...

http://codereview.chromium.org/3471006/diff/5001/6002
File buffered_file_writer.cc (right):

http://codereview.chromium.org/3471006/diff/5001/6002#newcode47
buffered_file_writer.cc:47: ssize_t rc_write = WriteBuffer();
On 2010/09/22 23:32:44, adlr wrote:
> it's a little weird if we have no buffered data, but should be okay

Added a guard in WriteBuffer so that empty buffers are not sent to the next
FileWriter.

Powered by Google App Engine
This is Rietveld 408576698