From cb72c75cfa4cc2d0eda30422e49715c4c604076c Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sat, 10 Sep 2022 22:20:54 +0200 Subject: [PATCH 1/5] Update release notes --- resources/release-notes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/release-notes.md b/resources/release-notes.md index 88a6cb2e..174d9e43 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,5 +1,9 @@ # Next +* ... + +# 0.42.1-20220910.153746 + * Bugfix: Memory leak (custom tabs). # 0.42.0-20220703.104316 From 4b147028feaa88243ba33d6d317cea02d2ea552a Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Tue, 13 Sep 2022 21:08:27 +0200 Subject: [PATCH 2/5] Use a private function instead of a public extension. It's way faster. --- NvimView/Sources/NvimView/NvimView+Draw.swift | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/NvimView/Sources/NvimView/NvimView+Draw.swift b/NvimView/Sources/NvimView/NvimView+Draw.swift index 126e8594..2d86be13 100644 --- a/NvimView/Sources/NvimView/NvimView+Draw.swift +++ b/NvimView/Sources/NvimView/NvimView+Draw.swift @@ -222,8 +222,7 @@ extension NvimView { columnRange: ClosedRange ) -> [AttributesRun] { rowRange.map { row in - self.ugrid.cells[row][columnRange] - .groupedRanges(with: { cell in cell.attrId }) + groupedRanges(of: self.ugrid.cells[row][columnRange]) .compactMap { range in let cells = self.ugrid.cells[row][range] @@ -273,3 +272,38 @@ private let infoTextAttrs = [ ] private let colorSpace = NSColorSpace.sRGB + +/// When we use the following private function instead of the public extension function in +/// Commons.FoundationCommons.swift.groupedRanges(with:), then, according to Instruments +/// the percentage of the function is reduced from ~ 15% to 0%. +/// Keep the logic in sync with Commons.FoundationCommons.swift.groupedRanges(with:). Tests are +/// present in Commons lib. +private func groupedRanges(of cells: ArraySlice) -> [ClosedRange] { + if cells.isEmpty { return [] } + if cells.count == 1 { return [cells.startIndex...cells.startIndex] } + + var result = [ClosedRange]() + result.reserveCapacity(cells.count / 2) + + let inclusiveEndIndex = cells.endIndex - 1 + var lastStartIndex = cells.startIndex + var lastEndIndex = cells.startIndex + var lastMarker = cells.first!.attrId // cells is not empty! + for i in cells.startIndex.. Date: Tue, 13 Sep 2022 21:09:28 +0200 Subject: [PATCH 3/5] Update release notes --- resources/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/release-notes.md b/resources/release-notes.md index 174d9e43..f26fcd9f 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,5 +1,6 @@ # Next +* Improve rendering performance. * ... # 0.42.1-20220910.153746 From dff3fc62f26c007ee533e8531b7cd2ae38c3eb79 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Tue, 13 Sep 2022 23:09:09 +0200 Subject: [PATCH 4/5] Bump version --- VimR/VimR.xcodeproj/project.pbxproj | 8 ++++---- VimR/VimR/Info.plist | 4 ++-- VimR/VimRTests/Info.plist | 4 ++-- resources/release-notes.md | 5 ++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/VimR/VimR.xcodeproj/project.pbxproj b/VimR/VimR.xcodeproj/project.pbxproj index 6c370122..5c3bea30 100644 --- a/VimR/VimR.xcodeproj/project.pbxproj +++ b/VimR/VimR.xcodeproj/project.pbxproj @@ -1127,7 +1127,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 20220910.153746; + CURRENT_PROJECT_VERSION = 20220913.230838; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -1188,7 +1188,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 20220910.153746; + CURRENT_PROJECT_VERSION = 20220913.230838; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -1217,7 +1217,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 20220910.153746; + CURRENT_PROJECT_VERSION = 20220913.230838; DEFINES_MODULE = YES; IBC_MODULE = VimR; INFOPLIST_FILE = VimR/Info.plist; @@ -1239,7 +1239,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 20220910.153746; + CURRENT_PROJECT_VERSION = 20220913.230838; DEFINES_MODULE = YES; IBC_MODULE = VimR; INFOPLIST_FILE = VimR/Info.plist; diff --git a/VimR/VimR/Info.plist b/VimR/VimR/Info.plist index d0f3cc75..6b214c13 100644 --- a/VimR/VimR/Info.plist +++ b/VimR/VimR/Info.plist @@ -1224,7 +1224,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.42.1 + 0.42.2 CFBundleSignature ???? CFBundleURLTypes @@ -1241,7 +1241,7 @@ CFBundleVersion - 20220910.153746 + 20220913.230838 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/VimR/VimRTests/Info.plist b/VimR/VimRTests/Info.plist index 873086d2..90332d44 100644 --- a/VimR/VimRTests/Info.plist +++ b/VimR/VimRTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.42.1 + 0.42.2 CFBundleSignature ???? CFBundleVersion - 20220910.153746 + 20220913.230838 diff --git a/resources/release-notes.md b/resources/release-notes.md index f26fcd9f..c222f2c2 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,8 +1,11 @@ # Next -* Improve rendering performance. * ... +# 0.42.2-20220913.230838 + +* Improve rendering performance. + # 0.42.1-20220910.153746 * Bugfix: Memory leak (custom tabs). From 184d3fec75f5533d02771de19e94f895d4206618 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Tue, 13 Sep 2022 23:18:12 +0200 Subject: [PATCH 5/5] Update appcast --- appcast.xml | 16 ++++++++-------- appcast_snapshot.xml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/appcast.xml b/appcast.xml index 081fe4fa..cf706a8f 100644 --- a/appcast.xml +++ b/appcast.xml @@ -6,22 +6,22 @@ Most recent changes with links to updates for VimR. en - v0.42.1-20220910.153746 + v0.42.2-20220913.230838 https://twitter.com/vimrefined - 20220910.153746 - v0.42.1 + 20220913.230838 + v0.42.2 -
  • Bugfix: Memory leak (custom tabs).
  • +
  • Improve rendering performance.
  • ]]>
    - https://github.com/qvacua/vimr/releases/tag/v0.42.1-20220910.153746 + https://github.com/qvacua/vimr/releases/tag/v0.42.2-20220913.230838 - 2022-09-10T15:46:20.838961 + 2022-09-13T23:18:03.725690 10.13.0 -
    diff --git a/appcast_snapshot.xml b/appcast_snapshot.xml index 081fe4fa..cf706a8f 100644 --- a/appcast_snapshot.xml +++ b/appcast_snapshot.xml @@ -6,22 +6,22 @@ Most recent changes with links to updates for VimR. en - v0.42.1-20220910.153746 + v0.42.2-20220913.230838 https://twitter.com/vimrefined - 20220910.153746 - v0.42.1 + 20220913.230838 + v0.42.2 -
  • Bugfix: Memory leak (custom tabs).
  • +
  • Improve rendering performance.
  • ]]>
    - https://github.com/qvacua/vimr/releases/tag/v0.42.1-20220910.153746 + https://github.com/qvacua/vimr/releases/tag/v0.42.2-20220913.230838 - 2022-09-10T15:46:20.838961 + 2022-09-13T23:18:03.725690 10.13.0 -