Skip to content
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

Fonts have a severe impact on build times #22

Closed
timboldt opened this issue Aug 9, 2020 · 6 comments
Closed

Fonts have a severe impact on build times #22

timboldt opened this issue Aug 9, 2020 · 6 comments

Comments

@timboldt
Copy link

timboldt commented Aug 9, 2020

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.)

@sago35
Copy link
Member

sago35 commented Aug 10, 2020

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
Copy link
Member

sago35 commented Aug 10, 2020

source: c5a301b

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

@deadprogram
Copy link
Member

deadprogram commented May 18, 2023

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?

@conejoninja
Copy link
Member

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.

@sago35
Copy link
Member

sago35 commented Dec 8, 2024

With the latest version, the build finishes in 11 seconds even without a cache. If the cache is present, it takes just 4 seconds. I believe this issue is no longer a problem.

$ git log -n1
commit cba4856f0e9917409bd809cfcf405228b3a2589b (HEAD -> dev, tag: v0.5.0, origin/release, origin/dev, origin/HEAD)
Author: deadprogram <ron@hybridgroup.com>
Date:   Wed Oct 30 18:27:52 2024 +0100

    modules: update to drivers 0.29.0

    Signed-off-by: deadprogram <ron@hybridgroup.com>

$ tinygo clean

$ go clean

$ tinygo version
tinygo version 0.35.0-dev-3b806217 windows/amd64 (using go version go1.23.2 and LLVM version 18.1.2)

$ time tinygo build -o app.hex --target wioterminal --size short ./examples/displays
   code    data     bss |   flash     ram
  12580   30780    6688 |   43360   37468

real    0m11.018s
user    0m0.000s
sys     0m0.000s

cached:

$ time tinygo build -o app.hex --target wioterminal --size short ./examples/displays
   code    data     bss |   flash     ram
  12580   30780    6688 |   43360   37468

real    0m4.252s
user    0m0.015s
sys     0m0.000s

@deadprogram
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants