Cross-posted to dev-platform and dev-extensions, as this may interest
add-on developers.

At the moment, nsSafeFileOutputStream calls Flush() whenever it is
closed. I would like to change that behavior.

For reference:
- flushing is quite expensive, even when executed off the main thread;
- even without flushing, nsSafeFileOutputStream already waits until the
file is completely written before renaming it to its destination, which
protects against most issues;
- flushing is only useful to protect to some degree against
kernel/hardware-level crashes (or hard reboots, power loss, removed
disk, etc.), which is something we need very rarely.

I believe that most users of nsSafeFileOutputStream only need the
renaming trick, not the flushing. Consequently, I would like to change
the behavior of nsSafeFileOutputStream to make flushing optional, and go
through the code to add the flush flag only for very valuable data.

Any thought?

Cheers,
 David

-- 
David Rajchenbach-Teller, PhD
 Performance Team, Mozilla
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to