Particle cli compile slow compared to Workbench compile

The Particle CLI compile command is slow in comparison to Workbench’s Compile application (local) command. Much, much slower.

I noticed that Workbench spits out this in the log:

make -f ‘/Users/…/.particle/toolchains/buildscripts/1.9.2/Makefile’ compile-user -s

If particle cli doesn’t support this faster compile, is it possible to call the make command directly? Is there any documentation on that?

I get this error when running the make command:

/bin/sh: line 0: cd: /main: No such file or directory

Workbench uses CLI for cloud compile, so I wouldn’t see how this can happen.

However, on first call in a new terminal (at least in Windows) CLI is always slow to do anything but will be fast on subsequent runs.

1 Like

The Particle CLI compile command is slow in comparison to Workbench’s Compile application (local) command.

which CLI command are you running exactly?

…is it possible to call the make command directly?

assuming you are in VSCode, you can run the Particle: Launch Compiler Shell command. not the most elegant api though :grimacing:

what @ScruffR says is accurate. i’d just add that Workbench’s local compiler also caches artifacts between builds so after the 1st run things go much faster. downside is sometimes it gets confused by the old cache data, spits out a weird error, and you need to reset things via cleaning (see the Particle: Clean application & DeviceOS (local) task for example).