wrye-bash icon indicating copy to clipboard operation
wrye-bash copied to clipboard

Reduce copying of records in the BP

Open Utumno opened this issue 3 years ago • 0 comments

We make way too many copies (deepcopy is really expensive!) - right now we copy every record that a patcher is interested in once for every mod in the load order, but we really only need a copy of the since that's the version of the record we'll let the patchers modify

  • [ ] Drop the getTypeCopy calls from the patchers
  • [ ] Add a new phase after scanLoadMods in which we make one(!) copy of every record in the BP
  • ~~save: getSize copies the entire grup in a BytesIO - we effectively dump the file twice. Replace this with dump returning the size and then seek back to write the size (O(top-groups) seeks can't be slower than this) - py3+~~ we would need too many seeks

Utumno avatar Jan 08 '23 17:01 Utumno