All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Optimizing C++ Singleton Performance: Best Practices and Implementation Guidance

By

jandeboevrie

2mo ago· 4 min readen

Summary

This article focuses on optimizing C++ singleton implementations for performance, using a display manager example from the Linux world (like GDM or LightDM). The author builds on a previous post about correct singleton implementation and now adds performance considerations, providing guidance on choosing the best implementation approach for specific use cases.

Key quotes

· 3 pulled
In my January post, I focused on implementing a singleton correctly. This time I want to add performance into the mix and show you the best way to implement your singleton... or give you guidance to pick your best way.
I'm using a display manager as an example, like GDM, LightDM, or others in the Linux world.
Let me quickly go through the various parts. In A, you see the data type Resolution which illustrates two resolutions; you can imagine the rest. Next in B, you find the DisplayManager implementation.
Snippet from the RSS feed
In my Januray post, I focused on implementing a singleton correctly. This time I want to add performance into the mix and show you the...

You might also wanna read