I would assume this is slower than loading the data from a JSON or similar file. If you present Typst with the data in a data file, it will load it into a more efficient format than if it is Typst source code. Typst source can contain way more varied content than json, toml, yaml, etc. so it will both take up more space in memory, and take more processing power when working through what the data mean.
In addition to this surface-level reason this may improve performance: Typst uses a lot of memoization for incremental compilation, and memoization works on distinct pieces of code. So reducing the amount of Typst code will likely also improve the situation in this regard.
Since it’s not, and I also was confused by this when reading through this thread, could you correct your posts to say .typ
instead? That will help readers in the future. Thanks!