PStore content update perf optimization. Patch by Masaki Matsushita.
See #5248.
lib/pstore.rb (save_data):
Delete inadequate Marshal check.
Deferred file truncation: when writing the new content, truncate
the saved file to the data size after writing the data, instead of
truncating whole bytes before writing data.
Deferred MD5 calculation: when comparing MD5 hash to check the
content modification, calculate MD5 hash of new data iif the
content length is differ from the old one.
Compare content size with String#bytesize instead of String#size.
PStore content update perf optimization. Patch by Masaki Matsushita.
See #5248.
lib/pstore.rb (save_data):
Delete inadequate Marshal check.
Deferred file truncation: when writing the new content, truncate
the saved file to the data size after writing the data, instead of
truncating whole bytes before writing data.
Deferred MD5 calculation: when comparing MD5 hash to check the
content modification, calculate MD5 hash of new data iif the
content length is differ from the old one.
Compare content size with String#bytesize instead of String#size.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e