Get the latest tech news

0+0 > 0: C++ thread-local storage performance


We discuss how to make sure that your access to TLS (thread-local storage) is fast, and how the presence of constructors and shared libraries affects the access time.

If you’re interested strictly in TLS performance guidelines and don't care about the details, — but be aware that you’ll be missing out on assembly listings of profound emotional depth, which can shake even a cynical, battle-hardened programmer. I’ve recently published a new C++ profiler, funtrace, which traces function calls & returns as well as thread state changes, showing an execution timeline like this (the screenshot is from Krita, a “real-world,” complicated drawing program): It seems that some changes to the optimization passes in 10 or 11 have significantly increased the impact of this problem.” “I've shown a workaround I used, which might be useful until GCC handle__tls_get_addr() as returning a constant addresses that doesn't need to be looked up multiple times in a function.“ “Thanks for the patch!

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Thread

Thread

Photo of C++

C++

Related news:

News photo

C++ on Steroids: Bjarne Stroustrup Presents Guideline-Enforcing 'Profiles' For Resource and Type Safety

News photo

Collection of one-file C/C++ libraries with no dependencies, primarily for games

News photo

From C++ to Clojure: Jank language promises best of both