mirror of
https://github.com/claunia/plist-cil.git
synced 2026-02-04 05:34:41 +00:00
[PR #45] [MERGED] Improve BinaryPropertyListWriter performance #68
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/claunia/plist-cil/pull/45
Author: @qmfrederik
Created: 6/20/2018
Status: ✅ Merged
Merged: 6/24/2018
Merged by: @claunia
Base:
master← Head:fixes/write-perf📝 Commits (2)
2825277Improve the performance of BinaryPropertyListWriter by using a Dictionary instead of a Collection to keep track of assigned indices.03e9d4dOnly run benchmarks on the current branch📊 Changes
5 files changed (+52 additions, -40 deletions)
View changed files
📝
.travis.yml(+0 -2)📝
appveyor.yml(+0 -2)📝
plist-cil/BinaryPropertyListWriter.AddObjectEqualityComparer.cs(+14 -1)📝
plist-cil/BinaryPropertyListWriter.GetObjectEqualityComparer.cs(+18 -1)📝
plist-cil/BinaryPropertyListWriter.cs(+20 -34)📄 Description
This PR improves the performance of the BinaryPropertyListWriter by using a
Dictionary<NSObject, int>to store the indices of binary objects instead of aCollection<NSObject>. It removes the need to do anIndexOf, which scans the entire list. That is a very expensive O(N) operation.This results in a 97% performance improvement on Windows (i.e. 30 times as fast) and a 98% performance improvement on Linux.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.