Bug 1361699 - Add buffer when writing hashstore to file r=gcp,mcmanus
We write a lot of 4-bytes prefixes to file which call many system calls. We should use a buffer and only write to file if the buffer is full or finish writing. nsIBufferedOutputStream is a good candidate to do that MozReview-Commit-ID: CzGOd7iXVTv
This commit is contained in:
@@ -976,8 +976,7 @@ HashStore::WriteFile()
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIOutputStream> out;
|
||||
rv = NS_NewCheckSummedOutputStream(getter_AddRefs(out), storeFile,
|
||||
PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE);
|
||||
rv = NS_NewCheckSummedOutputStream(getter_AddRefs(out), storeFile);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
uint32_t written;
|
||||
|
||||
Reference in New Issue
Block a user