~/talk

Avoiding Virtual Call in CRTP

Talkat C++Now 2018 · 2018-05-06..05-11· [c-and-cpp]
links:none on file
slides:none on file

Embedded serialization needs extremely low overhead so a virtual call is unacceptable. A CRTP-based base class replaces repeated implementations and an initial design with a virtual method shows a vcall in Visual Studio assembly. Replacing the virtual call by casting this to the derived type inside the base and invoking a static member lets the compiler resolve the call at compile time so the call becomes inlined by MSVC, yielding CRTP without runtime dispatch and meeting the performance constraint.

AI-written summary · about

  1. 0:00Start
  2. 0:17The Problem
  3. 1:12First Pass
  4. 1:48Generated Assembly
  5. 2:27Second Pass
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.