Title: [284922] trunk/Tools
Revision
284922
Author
[email protected]
Date
2021-10-27 08:29:52 -0700 (Wed, 27 Oct 2021)

Log Message

webkitdirs.pm should use JSON::XS when available
https://bugs.webkit.org/show_bug.cgi?id=232354

Reviewed by Dewei Zhu.

JSON::XS is faster than JSON::PP. While it doesn't matter for webkitdirs' own use,
where JSONs are tiny, other scripts that import webkitdirs.pm do care.

* Scripts/webkitdirs.pm:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (284921 => 284922)


--- trunk/Tools/ChangeLog	2021-10-27 15:24:39 UTC (rev 284921)
+++ trunk/Tools/ChangeLog	2021-10-27 15:29:52 UTC (rev 284922)
@@ -1,3 +1,15 @@
+2021-10-27  Alexey Proskuryakov  <[email protected]>
+
+        webkitdirs.pm should use JSON::XS when available
+        https://bugs.webkit.org/show_bug.cgi?id=232354
+
+        Reviewed by Dewei Zhu.
+
+        JSON::XS is faster than JSON::PP. While it doesn't matter for webkitdirs' own use,
+        where JSONs are tiny, other scripts that import webkitdirs.pm do care.
+
+        * Scripts/webkitdirs.pm:
+
 2021-10-26  Alex Christensen  <[email protected]>
 
         Remove properties set by NSURLProtocol on NSURLRequest before serializing

Modified: trunk/Tools/Scripts/webkitdirs.pm (284921 => 284922)


--- trunk/Tools/Scripts/webkitdirs.pm	2021-10-27 15:24:39 UTC (rev 284921)
+++ trunk/Tools/Scripts/webkitdirs.pm	2021-10-27 15:29:52 UTC (rev 284922)
@@ -42,12 +42,16 @@
 use File::Spec;
 use File::Temp qw(tempdir);
 use File::stat;
-use JSON::PP;
 use List::Util;
 use POSIX;
 use Time::HiRes qw(usleep);
 use VCSUtils;
 
+unless (defined(&decode_json)) {
+    eval "use JSON::XS;";
+    eval "use JSON::PP;" if $@;
+}
+
 BEGIN {
    use Exporter   ();
    our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to