Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fd25f01b7daf4be5c5cbe0b89ea6b2cb3d7cda7a
      
https://github.com/WebKit/WebKit/commit/fd25f01b7daf4be5c5cbe0b89ea6b2cb3d7cda7a
  Author: Sosuke Suzuki <aosuk...@gmail.com>
  Date:   2025-08-08 (Fri, 08 Aug 2025)

  Changed paths:
    A JSTests/microbenchmarks/source-mapping-url-inlined.js
    A JSTests/microbenchmarks/source-mapping-url-short.js
    M Source/JavaScriptCore/parser/Lexer.cpp

  Log Message:
  -----------
  [JSC] Scan `sourceURL` and `sourceMappingURL` with SIMD
https://bugs.webkit.org/show_bug.cgi?id=296939

Reviewed by Yusuke Suzuki.

JSC's Lexer currently scans sourceMappingURL and sourceURL directives character
by character. This change introduces SIMD optimization for LChar strings to
improve performance on large inline source maps.

When CharacterType is LChar, JSC treats the following 9 characters as directive
terminators:

- 0x09 (tab) through 0x0D (carriage return): \t, \n, \v, \f, \r
- 0x20 (space)
- 0x22 (double quote)
- 0x27 (single quote)
- 0xA0 (non-breaking space)

The SIMD implementation maintains identical behavior by detecting these same
characters. Characters 0x09-0x0D are detected using range checks for efficiency,
while the other characters are checked individually using bitwise OR operations.

                                    TipOfTree                  Patched

source-mapping-url-short          0.1542+-0.0380            0.1537+-0.0506
source-mapping-url-inlined        1.5875+-0.0425     ^      0.7537+-0.0311      
  ^ definitely 2.1062x faster

* JSTests/microbenchmarks/source-mapping-url-inlined.js: Added.
(eval.shouldBe):
* JSTests/microbenchmarks/source-mapping-url-short.js: Added.
(eval.shouldBe):
* Source/JavaScriptCore/parser/Lexer.cpp:
(JSC::parseCommentDirectiveValueSIMD):
(JSC::Lexer<CharacterType>::parseCommentDirectiveValue):

Canonical link: https://commits.webkit.org/298427@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to