Retrospective: Seven VM Engineering Years

358 views

Published on

Title: Retrospective: Seven VM Engineering Years
Speaker: Andres Valloud
Wed, August 20, 2:00pm – 2:30pm

Video Part1: https://www.youtube.com/watch?v=LdDIW2lrIrU
Video Part2: https://www.youtube.com/watch?v=0EcTg3shdq8

Description
Abstract: In this talk the presenter will summarize the lessons learned during 7 years of virtual machine development, looking at Smalltalk from the dual perspective of a VM engineer.

Bio: Andres Valloud has been lead VM engineer at Cincom from 2007 to 2014. He has also authored 3 books on Smalltalk, and currently works at LabWare.

Published in: Software
1 Comment
0 Likes
Statistics
Notes
  • Video Part1: https://www.youtube.com/watch?v=LdDIW2lrIrU
    Video Part2: https://www.youtube.com/watch?v=0EcTg3shdq8
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
358
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Retrospective: Seven VM Engineering Years

  1. 1. Retrospective Seven VM Engineering Years Andres Valloud
  2. 2. A typical VM project
  3. 3. A typical VM project “do something about 64 bits”
  4. 4. do something about 64 bits
  5. 5. do something about 64 bits ImageWriter
  6. 6. do something about 64 bits ImageWriter image format
  7. 7. Serialization image do something about 64 bits ImageWriter format
  8. 8. Serialization image do something about 64 bits ImageWriter format 32 vs 64 bits
  9. 9. Serialization image do something about 64 bits ImageWriter FFI, types format 32 vs 64 bits
  10. 10. Serialization image do something about 64 bits ImageWriter FFI, types format platform specs 32 vs 64 bits
  11. 11. Serialization do something about 64 bits ImageWriter FFI, types SmallInteger image format platform specs 32 vs 64 bits
  12. 12. Serialization do something about 64 bits ImageWriter FFI, types SmallInteger image format platform specs 32 vs 64 bits x86 code generators
  13. 13. Serialization do something about 64 bits ImageWriter FFI, types SmallInteger image format platform specs 32 vs 64 bits x86 code generators x86 specs
  14. 14. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types Floating point image format platform specs 32 vs 64 bits x86 code generators x86 specs
  15. 15. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types x86 specs Floating point image format platform specs 32 vs 64 bits x86 code generators IEEE-754
  16. 16. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types x86 specs IEEE-754 Floating point image format platform specs 32 vs 64 bits x86 code generators FPU specs
  17. 17. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types x86 specs IEEE-754 Floating point image format platform specs 32 vs 64 bits x86 code generators SmallDouble FPU specs
  18. 18. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types IEEE-754 Floating point image format platform specs 32 vs 64 bits x86 code generators SmallDouble FPU specs 32 bit bugs x86 specs
  19. 19. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types IEEE-754 Floating point image format platform specs prim returns 32 vs 64 bits x86 code generators SmallDouble FPU specs 32 bit bugs x86 specs
  20. 20. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types IEEE-754 Floating point prim returns pointer aliasing image format platform specs 32 vs 64 bits x86 code generators SmallDouble FPU specs 32 bit bugs x86 specs
  21. 21. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types Floating point prim returns pointer aliasing image format platform specs 32 vs 64 bits x86 code generators FPU specs C99 compiler manuals IEEE-754 SmallDouble 32 bit bugs x86 specs
  22. 22. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types Floating point prim returns pointer aliasing image format platform specs 32 vs 64 bits x86 code generators FPU specs C99 compiler manuals IEEE-754 SmallDouble 32 bit bugs SIGSEGV x86 specs
  23. 23. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types Floating point 32 bit bugs C compilers prim returns pointer aliasing image format platform specs 32 vs 64 bits x86 code generators FPU specs C99 compiler manuals IEEE-754 SmallDouble SIGSEGV x86 specs
  24. 24. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types Floating point prim returns pointer aliasing image format platform specs 32 vs 64 bits x86 code generators FPU specs C99 compiler manuals IEEE-754 SmallDouble SIGSEGV C compilers ABI violations 32 bit bugs x86 specs
  25. 25. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types Floating point prim returns pointer aliasing Garbage Collectors image format platform specs 32 vs 64 bits x86 code generators FPU specs C99 compiler manuals IEEE-754 SmallDouble SIGSEGV C compilers ABI violations 32 bit bugs x86 specs
  26. 26. Serialization SmallInteger do something about 64 bits ImageWriter FFI, types Floating point prim returns pointer aliasing Garbage Collectors image format platform specs 32 vs 64 bits x86 code generators FPU specs C99 compiler manuals IEEE-754 SmallDouble SIGSEGV C compilers ABI violations 32 bit bugs x86 specs
  27. 27. Speaking of GC
  28. 28. Speaking of GC “every efficient GC is a hybrid of reference counting and tracing”
  29. 29. Reference counting and tracing
  30. 30. Reference counting and tracing New Old Perm Eden S1 S2
  31. 31. Reference counting and tracing New Old Perm Eden S1 S2 RT
  32. 32. Reference counting and tracing New Old Perm Eden S1 S2 RT Old RT
  33. 33. Reference counting and tracing New Old Perm Eden S1 S2 RT Old RT IGC lists
  34. 34. Reference counting and tracing New Old Perm Eden S1 S2 RT Old RT IGC lists Class table
  35. 35. ... problems... Image <primitive: 123> C Hardware <foo.dll bar( )> prim123( ) {...} FFI OS, C libraries ... and rax, 3h... VM
  36. 36. ... problems... Image <primitive: 123> C Hardware <foo.dll bar( )> prim123( ) {...} FFI OS, C libraries ... and rax, 3h... VM UD
  37. 37. ... problems... Image <primitive: 123> C sigevent_t Hardware <foo.dll bar( )> prim123( ) {...} FFI OS, C libraries ... and rax, 3h... VM UD
  38. 38. ... problems... Image <primitive: 123> C sigevent_t Hardware <foo.dll bar( )> prim123( ) {...} FFI OS, C libraries ... and rax, 3h... VM UD port
  39. 39. ... problems... Image <primitive: 123> C sigevent_t macros, GetLastError() Hardware <foo.dll bar( )> prim123( ) {...} FFI OS, C libraries ... and rax, 3h... VM UD port
  40. 40. Long term vision
  41. 41. Long term vision “an excess of code cruft is preventing us from doing our jobs”
  42. 42. LOC over time 400k 320k 240k 160k 80k 0k ObjectWorks VW 2.x VW 3.x VW 5.x VW 7.x - 2007 VW 7.x - 2014 1990 1994 1997 2000 2003 2005 2008 2011
  43. 43. Progress over time 300 240 180 120 60 0 -60 -120 -180 Δ LOC / 500 VW 7.x - 2007 VM ARs closed Δ LOC / 500 VW 7.x - 2013 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.7.1 7.8 7.9 7.10
  44. 44. GC improvements 2010 VW 7.7 legacy VW 7.7.1 legacy sizesAtStartup VW 7.7.1 default 40,000 sec 30,000 sec 20,000 sec 10,000 sec 0 sec Ax100 Bx100 Cx400 Dx40 Ex40 Fx6 Gx6 A: pointer garbage B: byte garbage C: point creation Segmented container D: byte allocation E: pointer allocation Large container F: byte allocation G: pointer allocation
  45. 45. GC improvements 2013 2,000 sec 1,500 sec 1,000 sec 500 sec 0 sec VW 7.7.1 VW 7.10 Scavenge Stress GC Stress GC Deep Stack Stress Total VW 7.10’s GC ~45% faster than VW 7.7.1 overall
  46. 46. The message
  47. 47. The message “pauca sed matura”

×