Changes between Initial Version and Version 1 of JSCRegExpProcessingAndJSCGoals


Ignore:
Timestamp:
Oct 12, 2018 4:03:43 PM (3 years ago)
Author:
Jon Davis
Comment:

Notes from 2018 WebKit Contributors Meeting

Legend:

Unmodified
Added
Removed
Modified
  • JSCRegExpProcessingAndJSCGoals

    v1 v1  
     1= JavaScriptCore RegExp Processing =
     2''presented by Michael Saboff''
     3
     4Engine is called: YARR (Yet Another RegExp Runtime)
     5
     6Has both interpreter and JIT backends
     7
     8Uses backtracking algorithm (not DFA based)
     9
     10First thing that happens is that the YARR parses a regex and converts it into a YarrPattern.
     11
     12Then the YARR interpreter converts the YarrPattern into byte code that it can run.
     13
     14Question: Why not use a DFA based system?
     15It takes a lot longer to compile a DFA system. Also, because JS regular expressions are irregular you wouldn’t be able to have a DFA based system for that.
     16
     17Question: How would you know if you wanted to have more tiers of RexExps?
     18We would probably want to see what the areas the extra tier would help us. We would also want to know how often we are going see those cases.
     19
     20Optimizations that YARR does right now:
     21
     22Generate different code for different matching purposes. Sometimes the regexp is only used for matching other times they want to access the captured groups.
     23
     24Check multiple adjacent characters at once (up to 8)
     25
     26Remove unnecessary enclosing patterns: such as /.*abc.*/ which is the same as /abc/
     27
     28Character class canonicalization. Such as converting [12345] into (1 <= c && 5 <= c) instead of if (c == 1) return match; else if (c == 2) …
     29
     30= JSC Goals =
     31''presented by Saam Barati''
     32
     33JetStream 2:
     34
     35We think that the next thing JSC should optimize is BitInt.
     36We also want to improve our memory usage.
     37
     38New Bytecode format:
     39It separates the parts of the Bytecode specific to a particular function from the core instructions. This lets us share the core instructions across processes or save it to disk. Hopefully, it is a win for startup and for non-jit cases.
     40
     41JetStream 2, which is a new benchmark for JS performance that will be open sourced soon (TM).