From 1b96186d1418adcba85fdbfd794da2d2f6ea122d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 16 Jan 2018 16:43:55 +0100 Subject: Create new engine for each benchmark run Otherwise we end up with too many mmap'ed blocks as they appear not to be deallocated until the engine is destroyed. Change-Id: I88b8dd6d570423a492ddc6c7f105d0db97caa72d Task-number: QTBUG-60590 Reviewed-by: Erik Verbruggen Reviewed-by: Simon Hausmann --- tests/benchmarks/qml/holistic/tst_holistic.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/benchmarks/qml/holistic/tst_holistic.cpp b/tests/benchmarks/qml/holistic/tst_holistic.cpp index 791ae6812b..d7e71297f2 100644 --- a/tests/benchmarks/qml/holistic/tst_holistic.cpp +++ b/tests/benchmarks/qml/holistic/tst_holistic.cpp @@ -108,8 +108,6 @@ private slots: void typeResolution_data(); void typeResolution(); -private: - QQmlEngine engine; }; tst_holistic::tst_holistic() @@ -242,6 +240,7 @@ void tst_holistic::compilation_data() void tst_holistic::compilation() { + QQmlEngine engine; // This function benchmarks the cost of loading and compiling specified QML files. // If "repetitions" is non-zero, each file from "files" will be compiled "repetitions" // times, without clearing the engine's component cache between compilations. @@ -263,6 +262,7 @@ void tst_holistic::compilation() void tst_holistic::instantiation() { + QQmlEngine engine; // This function benchmarks the cost of instantiating components compiled from specified QML files. // If "repetitions" is non-zero, each component compiled from "files" will be instantiated "repetitions" // times, without clearing the component's instantiation cache between instantiations. @@ -297,6 +297,7 @@ void tst_holistic::instantiation() void tst_holistic::creation() { + QQmlEngine engine; // This function benchmarks the cost of loading, compiling and instantiating specified QML files. // If "repetitions" is non-zero, each file from "files" will be created "repetitions" // times, without clearing the engine's component cache between component creation. @@ -359,6 +360,7 @@ void tst_holistic::dynamicity_data() void tst_holistic::dynamicity() { + QQmlEngine engine; // This function benchmarks the cost of "continued operation" - signal invocation, // updating bindings, etc. Note that we take two different writeValues in order // to force updates to occur, and we read to force lazy evaluation to occur. @@ -472,6 +474,7 @@ void tst_holistic::cppToJsDirect_data() void tst_holistic::cppToJsDirect() { + QQmlEngine engine; // This function benchmarks the cost of calling from CPP scope to JS scope // (and possibly vice versa, if the invoked js method then calls to cpp). @@ -491,6 +494,7 @@ void tst_holistic::cppToJsDirect() void tst_holistic::cppToJsIndirect() { + QQmlEngine engine; // This function benchmarks the cost of binding scarce resources // to properties of a QML component. The engine should automatically release such // resources when they are no longer used. @@ -544,6 +548,7 @@ void tst_holistic::typeResolution_data() void tst_holistic::typeResolution() { + QQmlEngine engine; // This function benchmarks the cost of "continued operation" (signal invocation, // updating bindings, etc) where the component has lots of nested items with // lots of resolving required. Note that we take two different writeValues in order -- cgit v1.2.3