tinyfont icon indicating copy to clipboard operation
tinyfont copied to clipboard

Fonts have a severe impact on build times

Open timboldt opened this issue 4 years ago • 4 comments

I imagine this is more of a compiler issue (?), but I think it is worth noting here.

It is frustrating that including TinyFonts increases build times by 10x or more.

A partial workaround is to copy the desired font into your project, but it generally means renaming packages to make it work. (Maybe TinyGo 0.14 helps, now that it has module support.)

timboldt avatar Aug 09 '20 19:08 timboldt

I also get frustrated when building https://github.com/tinygo-org/tinyfont/blob/master/examples/pybadge/main.go on my windows laptop.

It might be better to use tinyfontgen on dev branch to create your own fonts. You can use the bdf file as input to create a new font. https://github.com/tinygo-org/tinyfont/tree/dev/cmd/tinyfontgen

sago35 avatar Aug 10 '20 03:08 sago35

source: https://github.com/tinygo-org/tinyfont/commit/c5a301ba5c68fdebfcc94d01d3d596b3a0f367b3

ubuntu 20.04 ryzen 3700

$ git rev-parse HEAD
c5a301ba5c68fdebfcc94d01d3d596b3a0f367b3

$ time tinygo build -o app.hex --target wioterminal --size short ./examples/displays
   code    data     bss |   flash     ram
  11712   32692    6364 |   44404   39056

real    0m13.646s
user    0m16.695s
sys     0m0.595s

windows 10 (git-bash) core i7-7600U

$ git rev-parse HEAD
c5a301ba5c68fdebfcc94d01d3d596b3a0f367b3

$ time tinygo build -o app.hex --target wioterminal --size short ./examples/displays/
   code    data     bss |   flash     ram
  11696   32692    6364 |   44388   39056

real    0m54.952s
user    0m0.000s
sys     0m0.015s

sago35 avatar Aug 10 '20 05:08 sago35

TinyGo caches things a lot better these days. Also compiler is faster overall than it was. Can we close this issue now in favor of new ones as needed?

deadprogram avatar May 18 '23 10:05 deadprogram

I vote for closing inactive issues, we could take a look at this : https://docs.github.com/en/github-ae@latest/actions/managing-issues-and-pull-requests/closing-inactive-issues

And close them by being inactive for X months (instead of days as proposed in the link). In case this is still an issue (after almost three years) it could be reopened.

conejoninja avatar May 18 '23 10:05 conejoninja