ACM Editorial · 2026-11-28 · 1 min read

Identify the actual bottleneck with profiling rather than guessing from code appearance.

Measure before optimisation

Identify the actual bottleneck with profiling rather than guessing from code appearance. Algorithms, allocation and I/O often matter more than individual arithmetic instructions. Keep a representative benchmark and compare repeatable runs.

Manage ownership explicitly

Use automatic storage and RAII where possible. Prefer standard containers and smart pointers for ownership. Raw pointers may represent non-owning references, but their lifetime must be clear to callers.

Prevent common correctness issues

Review bounds, integer conversions and concurrency. Undefined behaviour can make tests pass in one build and fail in another. Use compiler warnings, sanitizers and representative test cases during development.

Keep integration simple

Define clear interfaces between native and higher-level code. Document supported platforms and compiler settings. A native component adds deployment complexity, so adopt it only where the benefit is justified.

Further reading

https://isocpp.org/