Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm the exact opposite. I find the Arduino ide totally unusable. It takes forever to start up. Every operation is slow. It can take over ten seconds to open a small file and display it on an top of the line 12th gen Intel laptop

It literally recompiles all code on every verify or upload (because "we don't want lots of machine objects littering hard disks")

So on any of the mbed based boards compiles are like a minute or two for anything. On platformio and other compatible ways, it is instant.

So even for basic messing around I don't use the Arduino ide because it makes it not fun



> recompiles all code

This alone was reason for me to move to PlatformIO. It's infuriating.


> It can take over ten seconds to open a small file and display it on an top of the line 12th gen Intel laptop

What did you do to your computer? My 5 year old Ryzen desktop opens the Arduino IDE in ~1.5 seconds.


I can screencast it, but it's actually consistent even across OSes.

My top of the line macbook, with a fresh arduino 2.0 ide install on MacOS, is the same way.

Meanwhile, literally everything else works great.


I had something similar, I thought Arduino IDE was crazy slow, but then switched laptops and it was crazy fast. Not that the new laptop was more expensive or a lot newer, just different.

I blame windows stuff I guess, it's definitely not just CPU power


I mean, I'm on Linux, but I really wouldn't expect the JDK performance to be that different between operating systems.


I can make this happen on macos too :)


How can C++ compilation be slow if Arduino doesn't even use templates and the final binary is to fit in 32kb of ROM? If anything, recompiling all cpp files instead of individual object files with a link step shouldn't even have a noticeable speed difference


Yeah I don't even have a build system for my embedded C++ projects targeting 32-128K flash systems.

A main.cpp that includes all other .cpp files and a build.bat that recompile everything, it's always been instant.

And I do use a some amount of template and constexpr for peripheral setup code (computing all the constant values for GPIO config registers with a nice "DSL" of sort for example).


I have a significant C++20 app on zephyr (an RTOS), and it compiles to 65k on zephyr on an ARM board, and, with stripped/lto/etc to about 300k on ARM desktop (debug binaries are much larger, so it's not that). The only difference in code between the two (impressively for zephyr, IMHO) is some small GPIO/device abstractions to account for zephyr vs linux[1]. None of those take up any meaningful amount of code.

It all compiles nearly instantly. So you can have large apps that work fine in that space and time.

I haven't debugged the differences in compile options, etc. I suspect it is related to constant data handling differences (they both have the same RTTI, exceptions settings. They both use the same GCC version). But IMHO there can be very wide variation in the size of literally the same code.

In the case of arduino, they don't provide you anything that could be used to flamegraph it, but i suspect it's just recompiling a significant part of mbed each time or something.

The non-Mbed based ones are faster to compile for sure.

[1] The one thing Zephyr does not yet support is std::thread/std::mutex, but it's really easy to make it work in your app because the build system functions properly, so i did and sent them patches as an example. They are working on proper support in the toolchain. Just need to rebuild it with some different config flags and twiddle a few files. MBed fully supports std::thread/etc if i remember right.


Templates on their own aren't that slow, what is slow is doing crazy meta-programming tricks with them at compile time all over the place.


From my experience about 7 years ago, it was 10-100x faster under Linux (minutes compared to seconds), even though the Windows machine was way more powerful. Maybe file accesses are slowed down by something like an antivirus?


It's horrible. After futzing with it for a year or two for trivial test rig and automation stuff I switched to avr-gcc and avr-libc toolchains and just used vim and makefiles now.


Unfortunately yes. I ran a workshop with a group of students learning about digital electronics. They all installed the IDE and it was pretty much unusable except for on the faster laptops. The RP2040 was particularly bad, but the Mega*8 was a bit better. The problem seemed to be continual project indexing and no caching. It was also very difficult to see progress so often you'd hit upload and wait for tens of seconds before figuring out if anything had compiled or uploaded.

This is absolutely an Arduino problem. avr-gcc for a small program often compiles faster than the time it takes to upload with avrdude. And the IDE uses both underneath. Or compared to Atmel Studio, which is surprisingly not bad.


What kind of laptops are y'all using? My daily driver laptop is 7 years old and it compiles arduino stuff (uno) in like a couple of seconds.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: