~/talk

How HHVM Uses Modern C++ for Fun and Profit (Literally)

Talkat CppCon 2014 · on Monday, 2014-09-08· at 14:00· Euler· [rust]
links:none on file
slides:none on file

HHVM is a production JIT for PHP that claims 10x throughput and 75% memory reduction versus older PHP over several years; the implementation shows the specifics: C++11 features (templates, lambdas, move ctors, unrestricted unions), X‑macro tables for bytecode, jemalloc tweaks to get low‑address 32‑bit pointers, bit‑stealing in activation records (~48 bytes), an enterTC trampoline to switch between C++ and generated x64, perf-based profiling, register_frame for exception integration, huge pages to cut ITLB misses, and workarounds for virtual methods and non‑POD unions.

AI-written summary · about

  1. 0:00Intro
  2. 0:52What is HHVM?
  3. 1:45HHVM at Facebook
  4. 3:31Facebook Data Center
  5. 4:01Performance
  6. 4:33Productivity
  7. 5:39What can HHVM run?
  8. 6:24How does HHVM work?
  9. 7:10Basic Compilation Pipeline
  10. 8:38Tracelets
  11. 11:46Another translation example
  12. 13:56HHVM's Execution Model
  13. 14:33Why was C++ a good choice for building HHVM?
  14. 18:15Templates
  15. 23:13C++11's Lambdas
  16. 26:01X Macros
  17. 27:15Unions and field size
  18. 28:12TypedValue union
  19. 29:01Unsafe casts and bit-stealing
  20. 29:56Activation Records
  21. 33:58Bit-stealing with ActRecs
  22. 37:00Profiling
  23. 39:31Exception handling / unwinding
  24. 41:04Exception handling/ unwinding
  25. 43:37C++ / machine code interop
  26. 44:36enterTCHelper example
  27. 47:05Manual Memory Management
  28. 48:11Native allocation
  29. 49:26jemalloc
  30. 50:57Low addresses
  31. 52:20Memory Management for PHP
  32. 52:41HHVM's request allocator
  33. 53:23Huge pages
  34. 54:21Obstacles
  35. 54:55Unions and non-POD types
  36. 55:47C++11's Unrestricted Unions
  37. 56:36Avoiding unnecessary refcounting
  38. 57:06C++11's Move Constructors
  39. 57:53C++ instance methods
  40. 58:55C++ virtual methods
~/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.