Actually the libraries, when used, tend to have a fixed overhead. For example, digitalWrite allows for the pin number to be supplied at runtime, rather than compile time, and there is an overhead in doing that. Ditto for digitalRead, and various other things.
However the compiler generates pretty compact code after that. For example I made an adventure game, using an LCD, and button-detection, here:
The whole thing fitted on a Uno. I was more worried about the lengthy room descriptions filling up the program memory, than the overhead of the libraries.
Not like assembly which takes very little memory.
To amplify, if the assembly code did the same things as the libraries, you wouldn't save much (if any) by writing in assembly. I've done a lot of assembly programming in my day, I know the pros and cons of it. ![]()
