~/talk

“Fast Conversion From UTF-8 with C++, DFAs, and SSE Intrinsics”

Talkat CppCon 2018 · 2018-09-23..09-28· [web-platform]
links:none on file
slides:none on file

A DFA-based converter that uses three lookup tables and simple C++ code converts UTF-8 to UTF-32 while decoding, not as two steps, and uses SSE2 intrinsics to accelerate ASCII runs. The DFA maps to 9 states, 12 character classes; the full transition table is about 876 bytes (14 cache lines) with a 380-byte smaller variant. Benchmarks show the ASCII-optimized version ≈3–4× faster than iconv and the SSE path often 5–6× faster on tested Intel hardware; code assumes little-endian, aligned buffers and no runtime error checking.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03Outline
  3. 2:12Code Units
  4. 3:19Encoding
  5. 4:25Code Points
  6. 6:13What is UTF8
  7. 7:17ASCII byte sequences
  8. 9:30UTF8 byte sequences
  9. 11:01Overlong sequences
  10. 12:15Boundary conditions
  11. 15:52How does it work
  12. 16:50Simple DFAs
  13. 18:10How to recognize UTF8
  14. 21:47How to write a converter
  15. 29:14The DFA
  16. 30:10Basic Conversion Algorithm
  17. 34:43Benchmark
  18. 36:36Original Algorithm
  19. 48:33Benchmarks
  20. 48:46GCC Benchmarks
  21. 49:25Input Data
  22. 50:23Reference Libraries
  23. 50:50Testing Methodology
  24. 52:06Linux Results
  25. 55:45Windows Results
  26. 58:14Reusing the Library
  27. 59:09Reporting Errors
  28. 59:21Future Directions
~/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.