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

Sorry for the late reply. Been out for the past week.

I’m running particle compile bseries. I think I see whats happening. When I disconnect from the Internet entirely Workbench (VS Code) has no troubles. Compiles the code within a couple/few seconds. But when running the CLI it spits an error, “Compile failed: getaddrinfo ENOTFOUND api.particle.io”. So, its trying to phone home.

That would explain it for me. In the shop sometimes the WiFi can be terrible. The slow down is likely that its just network slowdown. Is there a way to disable any Internet call entirely?

(vim is my main editor, thats why I’m looking for a solution outside of VS Code)

This is a cloud compile command - without connection no cloud compile :wink:

So the answer to this …

… must be: “No - you cannot use particle compile without a working cloud connection”.

Is there a chance of calling the make command directly, which looks to be what Workbench is doing? Or is that a can of worms

I’ve been using https://po-util.com/ to compile locally for a while now, but it seems to be in transition at the moment.

interesting HEng. Thanks for the heads up. I’m interested to know what he has in mind going forward with the util.

Hey everyone.

Today I released neopo, a replacement for po-util:

1 Like

Thats great to hear. Looking forward to checking it out!