~/talk

The Bytecode Mumbo Jumbo

Talkat 360|AnDev 2017 · 2017-07-13..07-14· [android]
slides:none on file

Claims that the Java compiler defers real optimisation to the JVM and ART, demonstrated by disassembled bytecode with needless loads/stores and extra allocations; measurement shows boxing creates garbage and object-sorts scale much worse than primitive-sorts (big penalties on Nexus 5 and ART vs Dalvik differences). Tools used: javap/dexdump, dx and Jack. Concrete build: a YUV→RGB converter rewritten with fixed-point lookup tables runs measurably faster; Jack/minification produces different optimisations than javac/dx.

AI-written summary · about

  1. 0:00Intro
  2. 2:04Or, for example, on Android
  3. 2:22but change is coming! Jack & Jill
  4. 2:52Let's focus on javac Javac vs other compilers
  5. 3:06javac Does not produce optimized code
  6. 3:32For this reason Java bytecode & operations are stack based
  7. 3:50Quick example Stack based integer addition
  8. 6:08Java VM (JVM) All optimizations are left to be done by the JVM
  9. 8:23On Android there is jack to the rescue...
  10. 8:44And on Java there is the JIT compiler to the rescue
  11. 9:01Language additions Thinks to consider
  12. 12:54Autoboxing What about Jack?
  13. 13:53Language Additions Use them wisely!
  14. 14:18Difference between sorting primitive types & objects
  15. 15:22Loops What is going on behind the scenes
  16. 20:58Loops Use arrays instead of lists
  17. 23:11Calling a method Is there an overhead?
  18. 24:58String concatenation alternatives
  19. 30:10Slightly optimized version precalc tables, fixed point operations, 2 pixels per loop...
  20. 31:10Lets compare: Normal, minified, minified with optimizations & jack
  21. 32:36Performance measurements Avoid doing multiple tests in one run JIT might be evil!
~/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.