Use-package vs style in preamble makes Texmacs very slow

I do not completely understand the difference between specifying additional packages for a TeXmacs document in the <style> directive vs using the <use-package> macro. They are both mentioned in the documentation, but it seems that it is suggested to use <use-package> inside style files. Is this correct? In any case. Putting <use-package> macros into the preamble causes TeXmacs to become very slow (at least on my windows machine). I actually do not know how I ended up with a file with multiple <use-package> macros in the preamble. However one might want to warn in the manual here

TeXmacs style files (FSF GNU project)

that the <use-package> macro should NOT be used in actual files.

I would like to attach two example .tm files files with descriptive names. One is normal while the other one slows texmacs down to a crawl. However the forum is forbidding me from doing so.

The default way to include packages from a document seems to be through GUI, realized by clicking the plus button on the focus bar.

Maybe it is better to let Joris be aware that the document could be improved to make this clearer via bug report.

It seems to me that this happens only on Windows, on Linux typing inside the two documents feels approximately the same.

Thanks for posting the files, @guraltsev

For reference:
https://lists.texmacs.org/wws/arc/texmacs-users/2022-05/msg00051.html

I can confirm this on Windows. On Linux it is not very noticeable while typing text, but the bench debug tool show that pressing the Enter key after the first paragraph takes 1ms in fast-and-responsive versus 15ms in slow-and-sluggish.

My suspicion is that this has something to do with caching the style files. Opening fast-and-responsive creates a cache file __amsart__number-long-article__smart-ref__preview-ref__ in $TEXMACS_HOME_PATH\system\cache, while opening slow-and-sluggish creates a cache file __amsart__.

Notice that the style packages don’t get cached. This could mean TeXmacs is looking them up from disk at every key stroke.