~/talk

10 tips to write fast stack-safe functional code in Scala: the automatic-batch…

Talkat ScalaIO 2019 · 2019-10-29..10-31· [machine-learning]
slides:none on file

A hands-on report about building Auto-Batch, a pure FP Scala library that automatically batches API calls and ships to production; it lists 10 concrete tips: implement a free applicative to collect unitary calls, use smart constructors and inlining, transform problematic recursion with CPS and trampolining plus defunctionalization, and profile hot paths with VisualVM. Benchmarks show millisecond savings at the cost of CPU in places, real StackOverflowError failures drive these changes, and the library largely works in production with measured tradeoffs.

AI-written summary · about

  1. 0:00Intro
  2. 1:23The Context: Logistics
  3. 2:02The Problem: Going from A to Z.
  4. 7:23Benefits / Drawbacks
  5. 8:29Do not choose! Take benefits, leave drawbacks.
  6. 12:59Abstraction Implementation Abstractions must be Abstract
  7. 13:29Write your own Dedicated Abstractions
  8. 15:39Write your own Dedicated Data Types
  9. 15:57How does AutoBatch work? With Lots of Magic!
  10. 18:37Profile on Production Data!
  11. 22:13Make your functions tailrec via CPS
  12. 27:41Defunctionalization: Functions As Data
  13. 36:45Fibonacci: Final Version
~/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.