FYI - Build speed optimization - ccache massively speeds up build time

Open
#5,018 65 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, python

Research direction

Start by reviewing the discussion around ccache, auto-clean, release/debug/quick modes, and linking object files in the issue. The scope is not yet defined; done would require a maintainer-approved build optimization target, a clear failure condition for disabling auto-clean, and a way to validate the resulting build speed and correctness.

Written by the indexing model from the issue text.

Description

build system feature

Hi there, I'm making an emscripten docker file for platformio for a web compile of FastLED.

I've been grinding on build speed for the last week. I want to report that one of the biggest wins was slapping on ccache in front of the compiler.

As many have mentioned before, PlatformIO has a tendency to rebuild everything whenever order of deps/defines changes, which makes sense. ccache is a great way to mitigate that effect.

Today I discovered auto clean and disabling it. This makes it even faster. However I'm not sure what the failure condition is going to be with disabling auto-clean.

This compiler project is kind of a special case. Users pretty much just compile against FastLED. So my use case is how much can I pre-warm the ccache in release/debug/quick modes, stash that as a docker image layer. Then when a file is sent it just compiles then link against fastled. Right now I'm still dealing with linking against a bunch of object files. I've tried to combine this into a giant lib but no luck so far.

Dominant language
Python
Stars
9.6k
Forks
916
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from platformio/platformio-core

All issues in platformio/platformio-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.