What's the most efficient way to add an image, memory and compiling time wise?

I’m new to Typst and I’ve been reading about the new changes in 0.13 version.
My question is: I want to add an image in the header so it will show in every page using our template. What would be the most efficient way to add this image, memory and compiling time wise? I ask that because bytes could be an option to store the same data in one memory place, if I’m not wrong, but then how to write the right lines?

Welcome to the forum!

I didn’t feel comfortable answering your question before since I’m not an expert on this but now that some time has passed I’ll give my answer.

Since Typst uses memoization it shouldn’t matter which method you use. Even if you have `#image(“abc.jpg”) many times in your document, there will only ever be one space in the computer’s memory containing the image data. And each header that appears on a page that is created using the same code will not add a lot of overhead.

There may be small differences and if you care about those I would suggest measuring the compile times of some test documents.

2 Likes