Skip to content

Commit

Permalink
dynamic dispatch perf hit explained
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelraz committed Sep 18, 2024
1 parent e909ddb commit f97a31a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions training-slides/src/dynamic-dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ impl Operation {

Try to minimize repeated matches on the Enum, if not strictly necessary.

This reduces overhead from the virtual table lookups.

Note:

These may be optimized away by LLVM in devirtualization passes.

## Trait Objects

References or raw pointers on traits, also boxes, describe so-called *trait objects*.
Expand Down

0 comments on commit f97a31a

Please sign in to comment.