Optimization

last modified: October 23, 2025

Class or Module for Singletons?

Posted on 2019-07-09— C++, Improve your Code, Learn

I compare implementing a singleton as a class or as a module/namespace for Arduino firmware using simple LED driver examples and compiler measurements. I cover size, initialization and runtime trade-offs and explain when each approach makes sense. Read the full post for code, disassembly and practical recommendations.

Read this post