-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(URGENT) Critical performance problem caused by recent refactoring #159
Comments
@kwkwan do you think this has anything to do with the recent |
The most recent docker release still works: However, the local build is messed up. I only have |
thanks for checking this
just to clarify here: |
Since the entirety of mn-samples-plateau, INCLUDING 001-v5, ran last week with the gems of that metanorma release on docker in 48 mins https://github.com/metanorma/metanorma-cli/actions/runs/12876911452/job/35964616845 the "caused by recent refactoring" ranges from unlikely to nonsensical as having anything to do with metanorma. I am now leaving this running on my side to find out what is going on, but I had no issues at all my side last week. If this turns out not to do with metanorma but with lutaml. I will report back on my findings. |
If this turns out to be lutaml (and if you're hearing nothing from metanorma, that is my suspicion), it would be useful for the metanorma lutaml plugin to introduce some sort of progress reporting, as I had done for AsciiMath processing... |
After 1.5 hours, I get:
That is still Asciidoctor processing, not Metanorma, which pretty much tells me straight that the delay is in Lutaml, since that is embedded within Asciidoc preprocessing. I'm going to restart and monitor metanorma-plugin-lutaml. |
The Lutaml preprocessors are all pretty fast:
Each instance of LutamlKlassTableBlockMacro is taking something like half a minute to run. Will leave it running for a half hour to see how far it gets.... |
20 minutes in, it's chugging along, alternating runs of LutamlKlassTableBlockMacro and runs of LutamlGmlDictionaryBlockMacro. It has processed 150 such blocks so far. I have left an warning in for when Metanorma processing starts, and I am going out in 10 mins, but I will leave it running for a few hours to see what is going on... |
30 minutes, 230 blocks processed. Whether or not it hangs, the slowdown is clearly in Lutaml. I'll leave it running, though I will be out for a few hours... |
45 mins, 300 blocks. I'm going out... |
Got back, it finished doing Lutaml processing after 1.5 hours, and then it crashed because I had a bug when I wrote the warning for it starting Metanorma. I'm now restarting it, and I'll see what happens next. I think that is a real slowdown compared to before in Lutaml that needs to be addressed, I just want to confirm that there isn't an issue downstream in Metanorma. |
On my computer: Lutaml took 1.5 hrs to run Metanorma took 1 minute and compiled successfully.
Wrong. This is not my problem. It's @kwkwan 's. |
hello @opoudjis thank you for investigating this and providing the details. i will follow up with @ronaldtse and @kwkwan . |
This may be a lutaml-model performance issue since that's the only change at the "xmi" gem: it migrated from Shale to lutaml-model. Ping @HassanAkbar |
@ronaldtse I have investigated this performance issue thoroughly, and here are the findings:
Here are the benchmarking results from a sample spec of Benchmarking of As you can see it takes ~3 seconds to deserialize xml from xmi.
![]() Conclusion: |
Thanks @HassanAkbar for pinpointing the problem. I agree with the next steps on performance improvement by eliminating the doc_hash. My next question is: why are we calling to_xml? In this usage there is no XML generated through lutaml-model... what I mean is there could be another location of inefficiency that is not to_xml. |
Technically, this document generation only uses "to_liquid" in the "xmi" gem. I wonder if there is a performance issue there as well. Ping @kwkwan |
hello @HassanAkbar thank you for looking into this. i generated the document locally and it successfully completed but took 3 hrs and 40min to complete. over the past two weeks the client and i were discussing and testing liquid template updates with @kwkwan for the sorting order of the autogenerated UML tables in the Plateau Project (mn-samples-plateau). late last week i requested the updated template PRs be merged to the main branch. i did not know there were other non-liquid updates being made. regularly the document took about 1hr 30min to run. there were updates to lutaml in Nov 2024 that solved some speed issues at that time. after that i believed the only changes were mostly to the liquid-templates which are document specific in the mn-samples-plateau repo. these templates are used in the autogenerated tables in sources/001-v5. do you think there is some type of looping/evaluation issue in the liquid template that could be causing this slowdown? i believe the liquid templates look at the data coming from the xmi and considers it by row or possibly by cell in each table. with a couple hundred tables that could cause a slowdown if there was a problem with the templates. however, the document compile successfully completes. the client is now checking if those sorting order updates to the UML tables are still correct. not sure if this is helpful information or not. thanks for checking into this. |
@ronaldtse, actually the issue here is not with
I am working to eliminate step 2 so that the instance is directly created from the adapter instance, improving performance and saving time. |
hello @HassanAkbar is there anything to report on the status of this issue? do let us know when you have feedback to discuss. thank you for working on this. |
Hi @ronaldtse, the main differences between v0.3.11 and later of the gem I compared the time consumed for running In the meanwhile, we can pin the version of the gem |
FYI. It takes 33m to compile |
wow, that is a great improvement! trying to test now based on the info from the other issue. thank you. |
As reported by @ReesePlews :
Previously, the 001-v5 document (
sources/001-v5/document.adoc
) compiled in around 1 hour.Now the document takes over 3 hours without even any error message (and does not complete).
I suspect that the recent XML refactoring has introduced critical inefficiencies that is not working with big documents.
The delivery date for Plateau is Jan 30 and this should be addressed by then.
The text was updated successfully, but these errors were encountered: