[PR #45] [MERGED] Improve BinaryPropertyListWriter performance #68

Open
opened 2026-01-30 21:27:00 +00:00 by claunia · 0 comments
Owner

📋 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: masterHead: fixes/write-perf


📝 Commits (2)

  • 2825277 Improve the performance of BinaryPropertyListWriter by using a Dictionary instead of a Collection to keep track of assigned indices.
  • 03e9d4d Only 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 a Collection<NSObject>. It removes the need to do an IndexOf, 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.

## 📋 Pull Request Information **Original PR:** https://github.com/claunia/plist-cil/pull/45 **Author:** [@qmfrederik](https://github.com/qmfrederik) **Created:** 6/20/2018 **Status:** ✅ Merged **Merged:** 6/24/2018 **Merged by:** [@claunia](https://github.com/claunia) **Base:** `master` ← **Head:** `fixes/write-perf` --- ### 📝 Commits (2) - [`2825277`](https://github.com/claunia/plist-cil/commit/2825277a45a747571953f4b5059ce32f847c0090) Improve the performance of BinaryPropertyListWriter by using a Dictionary instead of a Collection to keep track of assigned indices. - [`03e9d4d`](https://github.com/claunia/plist-cil/commit/03e9d4d968c053e649589db17833d1aef2f3f4be) Only run benchmarks on the current branch ### 📊 Changes **5 files changed** (+52 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `.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) </details> ### 📄 Description This PR improves the performance of the BinaryPropertyListWriter by using a `Dictionary<NSObject, int>` to store the indices of binary objects instead of a `Collection<NSObject>`. It removes the need to do an `IndexOf`, 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-30 21:27:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claunia/plist-cil#68