From c895162296dddde2aaa173499d7b59c0034734ac Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 20 Aug 2018 16:55:48 +0200 Subject: Clarify docs of WorkerScript with regards to memory usage Since now each WorkerScript has its own JS engine, let's document that to explain the reason (isolation), impact (memory consumption) as well as how to deal with it (sharing). Change-Id: I8007a58aaa96f989bc9e72e68dacd87655a8a8cc Reviewed-by: Michael Brasser Reviewed-by: Lars Knoll --- src/qml/types/qquickworkerscript.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qml/types') diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index f8616bf709..cf3bead048 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -512,6 +512,10 @@ void QQuickWorkerScriptEngine::run() If a worker script has the extension ".js" instead, then it is considered to contain plain JavaScript statements and it is run in non-strict mode. + \note Each WorkerScript element will instantiate a separate JavaScript engine to ensure perfect + isolation and thread-safety. If the impact of that results in a memory consumption that is too + high for your environment, then consider sharing a WorkerScript element. + \section3 Restrictions Since the \c WorkerScript.onMessage() function is run in a separate thread, the -- cgit v1.2.3