aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2022-02-21 15:02:31 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2023-02-07 09:20:11 +0000
commit087c22e17721f37490dd2048a567b6a58065d939 (patch)
tree3a04067c29884685fe7189b5c51c1fff82f214d9 /doc
parent4e8f377f1844bbb2f5ed7cb4481d6e30a6335da5 (diff)
Switch JavaScript back-end
Newer clang versions seem to expose serious bugs in QtScript, whose complexity makes it difficult to track them down. We therefore switch to the more light-weight QuickJS, which offers all the features we need (most notably property access interception), as well as good performance. To save some porting effort, we removed the long-deprecated loadFile() and loadExtension() functions. During the porting procedure, we noticed and fixed thread safety issues in artifact access from JS commands. We consider this change important enough to bump the major version, so the next release will be 2.0. Detailed benchmarking data is below. In summary, we see a modest speed- up at the cost of a similarly modest increase in memory consumption (with the exception of project resolving on macOS, which has become a bit slower). Importantly, the increase does not rise with project size, as the comparison of qbs vs Qt Creator shows. Output of qbs_benchmarker on Linux with qbs as test project: ========== Performance data for Resolving ========== Old instruction count: 12870602895 New instruction count: 11923459780 Relative change: -8 % Old peak memory usage: 61775848 Bytes New peak memory usage: 67583424 Bytes Relative change: +9 % ========== Performance data for Rule Execution ========== Old instruction count: 4074062223 New instruction count: 3887473574 Relative change: -5 % Old peak memory usage: 35123704 Bytes New peak memory usage: 38398392 Bytes Relative change: +9 % ========== Performance data for Null Build ========== Old instruction count: 1104417596 New instruction count: 1011033948 Relative change: -9 % Old peak memory usage: 24461824 Bytes New peak memory usage: 25325920 Bytes Relative change: +3 % Output of qbs_benchmarker on Linux with Qt Creator as test project: ========== Performance data for Resolving ========== Old instruction count: 67166450352 New instruction count: 60772791018 Relative change: -10 % Old peak memory usage: 327011616 Bytes New peak memory usage: 343724176 Bytes Relative change: +5 % ========== Performance data for Rule Execution ========== Old instruction count: 71684351183 New instruction count: 67051936965 Relative change: -7 % Old peak memory usage: 374913688 Bytes New peak memory usage: 387790992 Bytes Relative change: +3 % ========== Performance data for Null Build ========== Old instruction count: 8383156078 New instruction count: 7930705668 Relative change: -6 % Old peak memory usage: 180468360 Bytes New peak memory usage: 182490384 Bytes Relative change: +1 % Real-world data building Qt Creator (using qbs --log-time, several runs, removing outliers): macOS: Resolving: 43s -> 47s Rule execution: 17s -> 14s Windows: Resolving: 18s -> 16s Rule execution: 22s -> 17s Fixes: QBS-913 Fixes: QBS-1103 Fixes: QBS-1126 Fixes: QBS-1227 Fixes: QBS-1684 Change-Id: Ie5088155026e85bbd1e303f1c67addb15810a3cb Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/codeattributions.qdoc49
-rw-r--r--doc/qbs.qdoc6
2 files changed, 48 insertions, 7 deletions
diff --git a/doc/codeattributions.qdoc b/doc/codeattributions.qdoc
index cdd58b159..092f7794f 100644
--- a/doc/codeattributions.qdoc
+++ b/doc/codeattributions.qdoc
@@ -180,7 +180,7 @@ modification, are permitted provided that the following conditions are met:
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of biplist nor the names of its contributors may be
- used to endorse or promote products derived from this software without
+ used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
@@ -239,3 +239,50 @@ Copyright (c) 2008 Roberto Raggi
// THE SOFTWARE.
\endcode
*/
+
+/*!
+
+\ingroup attributions-libs
+\ingroup attributions-qbs
+\page qbs-attribution-quickjs.html attribution
+\target quickjs
+
+\title QuickJS
+\brief MIT License
+
+The JavaScript engine used to evaluate all JavaScript code in \QBS project files.
+
+The sources can be found in src/shared/quickjs.
+
+\badcode
+Copyright (c) 2017-2021 Fabrice Bellard
+Copyright (c) 2017-2021 Charlie Gordon
+\endcode
+
+\l{https://spdx.org/licenses/MIT.html}{MIT License}.
+
+\badcode
+QuickJS Javascript Engine
+
+Copyright (c) 2017-2021 Fabrice Bellard
+Copyright (c) 2017-2021 Charlie Gordon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+\endcode
+*/
diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc
index 7fcc7e68b..6b5981674 100644
--- a/doc/qbs.qdoc
+++ b/doc/qbs.qdoc
@@ -556,7 +556,6 @@
\row \li qbs_no_dev_install \li Exclude header files from installation, that is, perform a
non-developer build.
\row \li qbs_no_man_install \li Exclude the man page from installation.
- \row \li qbs_use_bundled_qtscript \li Use the bundled QtScript library.
\endtable
In addition, you can set the \c QBS_SYSTEM_SETTINGS_DIR environment variable
@@ -643,11 +642,6 @@
\li Holds whether the Qt libraries that \QBS depends on will be bundled with \QBS during
the \c install step. This option is only implemented on macOS.
\row
- \li useBundledQtScript
- \li \c false
- \li Use the bundled QtScript module instead of the one shipped with Qt. In that case,
- QtScript should be checked out as a git submodule.
- \row
\li libDirName
\li \c "lib"
\li Directory name used by \c libInstallDir and \c importLibInstallDir properties.