Have you tried IRIS 2023.3, 2024.1 or 2025.1? Which improves cross routine references for routines with lots of public variables. My experience from moving from IRIS 2022.1 to IRIS 2024.1 was a 15% to 20% improvement in compute time to execute ObjectScript.
When using public variables in an ObjectScript routine, the InterSystems IRIS kernel needs them to be registered in an in-memory symbol table that is specific to the routine. Starting with InterSystems IRIS 2023.3, this symbol table is built lazily, only adding public variables upon their first reference. This means only variables actually used in the routine are added to the symbol table, which may significantly reduce the cost of building it. This is an entirely transparent change to internal memory management, but it may yield noticeable performance gains for ObjectScript code that makes significant use of public variables.
Have you tried IRIS 2023.3, 2024.1 or 2025.1? Which improves cross routine references for routines with lots of public variables. My experience from moving from IRIS 2022.1 to IRIS 2024.1 was a 15% to 20% improvement in compute time to execute ObjectScript.
https://docs.intersystems.com/iris20241/csp/docbook/DocBook.UI.Page.cls?KEY=GCRN_new20233#GCRN_new20233_speed_faster
Faster ObjectScript Runtime
When using public variables in an ObjectScript routine, the InterSystems IRIS kernel needs them to be registered in an in-memory symbol table that is specific to the routine. Starting with InterSystems IRIS 2023.3, this symbol table is built lazily, only adding public variables upon their first reference. This means only variables actually used in the routine are added to the symbol table, which may significantly reduce the cost of building it. This is an entirely transparent change to internal memory management, but it may yield noticeable performance gains for ObjectScript code that makes significant use of public variables.