Repository navigation
fix: parse each resource cfg once in workspace export and CLI generation - #577
Open
Jian Hui (huiii99) wants to merge 2 commits into
Open
Jian Hui (huiii99) wants to merge 2 commits into
Jian Hui (huiii99) wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Workspace export and CLI generation for
network application-gatewayeach take roughly 1.7-2 hours, while smaller command groups finish in seconds.Root Cause
The application-gateway cfg contains 146 commands in 15.2 MB. Both flows repeatedly deserialize the entire shared cfg for individual commands, at roughly 36-40 seconds per parse.
This PR processes each workspace cfg editor once during export and caches parsed readers by
(plane, resource_id, version)within each CLI profile. Workspace cache entries are readonly snapshots: writers load independent editors, restore class-reference links, and publish only after a successful save.Benchmark
Same inputs on AMD EPYC 7763, Python 3.12.10, schematics 2.1.1. Application Gateway uses API version
2026-01-01; CLI generation uses PATCH mode with its commands marked modified.The original CLI run overlapped with the original export run, so its baseline includes resource contention.
Testing