Skip to content

Commit ef3cd96

Browse files
Minor improvements for post
1 parent 729fc40 commit ef3cd96

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Content.org

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,8 +1331,9 @@ a virtual table (~vtable~) is created /for each class/, and a pointer
13311331
On a virtual call, the compiler loads the ~vptr~, selects the right slot
13321332
in the ~vtable~, and performs an indirect call through that function
13331333
pointer. The drawback is that the extra ~vptr~ increases object size,
1334-
and the ~vtable~ makes the call hard to predict. This prevents
1335-
inlining, increases branch mispredictions, and reduces cache efficiency.
1334+
and the indirection through the ~vtable~ makes the call hard to predict.
1335+
This prevents inlining, increases branch mispredictions, and reduces
1336+
cache efficiency.
13361337

13371338
The best way to observe this phenomenon is by inspecting the
13381339
assembly[fn:4] code emitted by the compiler for a minimal example

content/posts/devirtualization-and-static-polymorphism.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ a virtual table (`vtable`) is created _for each class_, and a pointer
3030
On a virtual call, the compiler loads the `vptr`, selects the right slot
3131
in the `vtable`, and performs an indirect call through that function
3232
pointer. The drawback is that the extra `vptr` increases object size,
33-
and the `vtable` makes the call hard to predict. This prevents
34-
inlining, increases branch mispredictions, and reduces cache efficiency.
33+
and the indirection through the `vtable` makes the call hard to predict.
34+
This prevents inlining, increases branch mispredictions, and reduces
35+
cache efficiency.
3536

3637
The best way to observe this phenomenon is by inspecting the
3738
assembly[^fn:1] code emitted by the compiler for a minimal example

0 commit comments

Comments
 (0)