From 4913dd2ddd5cad981a257e8fe5ca69756639b2af Mon Sep 17 00:00:00 2001 From: Raymond Rebbeck Date: Sat, 6 Jun 2026 17:44:10 +0930 Subject: [PATCH 1/4] Use a work queue manager in the IncrementalLoad pull event handler when importing items to improve performance Only used when decomposed productions are not in use, these will very likely require further locking being implemented to ensure that productions are created and updated safely. --- .../Git/PullEventHandler/IncrementalLoad.cls | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls index 3f888277..c9e18334 100644 --- a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls +++ b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls @@ -20,6 +20,17 @@ Method OnPull() As %Status } } + // Create a work queue manager to use for importing items to improve performance + // Currently only used when not using decomposed productions + #dim queue as %SYSTEM.WorkMgr = "" + set settings = ##class(SourceControl.Git.Settings).%New() + if ('settings.decomposeProductions) { + set queue = ##class(%SYSTEM.WorkMgr).%New() + if (queue = "") { + set sc = $$$ADDSC(sc, %objlasterror) + } + } + set nFiles = 0 for i=1:1:$get(..ModifiedFiles){ set internalName = ..ModifiedFiles(i).internalName @@ -45,11 +56,21 @@ Method OnPull() As %Status set ptdList(internalName) = "" } else { set compilelist(internalName) = "" - set sc = $$$ADDSC(sc,##class(SourceControl.Git.Utils).ImportItem(internalName, 1)) + // If a work queue has been created then use it + if (queue '= "") { + set sc = $$$ADDSC(sc, queue.Queue("##class(SourceControl.Git.Utils).ImportItem", internalName, 1)) + } else { + set sc = $$$ADDSC(sc, ##class(SourceControl.Git.Utils).ImportItem(internalName, 1)) + } } } } + // If a work queue was created then wait for all work to finish + if (queue '= "") { + set sc = $$$ADDSC(sc, queue.Sync()) + } + #; First remove production items, then everything else write:$data(delList) !!,"Removing items..." for orderIndex = 1,2 { From 9e485fb2979bdf5641c0cc527880d27b51ecdbb5 Mon Sep 17 00:00:00 2001 From: Raymond Rebbeck Date: Sun, 7 Jun 2026 21:36:00 +0930 Subject: [PATCH 2/4] Change DeleteFile and RemoveItem into class methods to allow use with a work queue manager These are not used anywhere else outside of this class and don't do anything that requires them to be methods as opposed to class methods. --- cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls index c9e18334..de7eab86 100644 --- a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls +++ b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls @@ -116,7 +116,7 @@ Method OnPull() As %Status quit sc } -Method RemoveItem(pInternalName, pExternalName) As %Status +ClassMethod RemoveItem(pInternalName, pExternalName) As %Status { #Dim delSC As %Status set delSC = ..DeleteFile(pInternalName, pExternalName) @@ -129,7 +129,7 @@ Method RemoveItem(pInternalName, pExternalName) As %Status quit delSC } -Method DeleteFile(item As %String = "", externalName As %String = "") As %Status +ClassMethod DeleteFile(item As %String = "", externalName As %String = "") As %Status { #Dim sc As %Status = $$$OK #Dim err As %Exception.AbstractException From 7f562214fbfe049dd57768978f73ca0eeb8d459e Mon Sep 17 00:00:00 2001 From: Raymond Rebbeck Date: Sun, 7 Jun 2026 21:38:33 +0930 Subject: [PATCH 3/4] Use the work queue manager in the IncrementalLoad pull event handler when deleting items to improve performance --- .../Git/PullEventHandler/IncrementalLoad.cls | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls index de7eab86..f72cec2a 100644 --- a/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls +++ b/cls/SourceControl/Git/PullEventHandler/IncrementalLoad.cls @@ -20,7 +20,7 @@ Method OnPull() As %Status } } - // Create a work queue manager to use for importing items to improve performance + // Create a work queue manager to use for importing and deleting items to improve performance // Currently only used when not using decomposed productions #dim queue as %SYSTEM.WorkMgr = "" set settings = ##class(SourceControl.Git.Settings).%New() @@ -76,10 +76,21 @@ Method OnPull() As %Status for orderIndex = 1,2 { set item = $order(delList(orderIndex, ""), 1, tExternalName) while (item '= "") { - set delSC = ..RemoveItem(item, tExternalName) + // If a work queue has been created then use it + if (queue '= "") { + set delSC = queue.Queue("..RemoveItem", item, tExternalName) + } else { + set delSC = ..RemoveItem(item, tExternalName) + } set item = $order(delList(orderIndex, item), 1, tExternalName) } } + + // If a work queue was created then wait for all work to finish + if (queue '= "") { + set sc = $$$ADDSC(sc, queue.Sync()) + } + if (nFiles = 0) { write !, "Nothing to Load." quit $$$OK From 17d0eba1e65fdbc85a1b9c55ab5bed525eee426f Mon Sep 17 00:00:00 2001 From: Raymond Rebbeck Date: Sun, 7 Jun 2026 23:56:35 +0930 Subject: [PATCH 4/4] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27465f59..b21b3c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - `ImportAll` imports items in parallel when `compileOnImport` and `decomposeProductions` are both disabled, reducing import time for large codebases (#970) +- The Incremental Load pull event handler can import and delete items in parallel when `decomposeProductions` is disabled, reducing the time required for various operations (#973) - Import of decomposed production items now has a brief timeout in case another deploy is in progress (#949) - Option to view an individual file's history in the source control menu (#960) - Change context menu now lists IPM packages from all Git-enabled namespaces, prefixed with the namespace name (#952)