on xenial help sign in
Benchmark various card models
d482a3eAlbert Astals
tests/qmltests/Dash/tst_CardBenchmark.qml+26−9
@@ -36,17 +36,18 @@ Rectangle {
36 "summary": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
36 "summary": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
37 }'
37 }'
38
38
39+ property string currentModel
39−// property string cardModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot", "summary": "summary" } }'
40+ property string cardTitleArtSubtitleMascotSummaryModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot", "summary": "summary" } }'
40−// property string cardModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot" } }'
41+ property string cardTitleArtSubtitleMascotModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot" } }'
41− property string cardModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle" } }'
42+ property string cardTitleArtSubtitleModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle" } }'
42−// property string cardModel: '{ "components": { "title": "title", "art": "art" } }'
43+ property string cardTitleArtModel: '{ "components": { "title": "title", "art": "art" } }'
43−// property string cardModel: '{ "components": { "art": "art" } }'
44+ property string cardArtModel: '{ "components": { "art": "art" } }'
44−// property string cardModel: '{ "components": { "title": "title" } }'
45+ property string cardTitleModel: '{ "components": { "title": "title" } }'
45
46
46 CardTool {
47 CardTool {
47 id: cardTool
48 id: cardTool
48− template: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(cardModel))['template'];
49+ template: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(currentModel))['template'];
49− components: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(cardModel))['components'];
50+ components: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(currentModel))['components'];
50 viewWidth: units.gu(48)
51 viewWidth: units.gu(48)
51 }
52 }
52
53
@@ -69,7 +70,23 @@ Rectangle {
69
70
70 when: windowShown
71 when: windowShown
71
72
73+ function benchmark_time_data() {
74+ return [
75+ { tag: "cardTitleArtSubtitleMascotSummaryModel", model: cardTitleArtSubtitleMascotSummaryModel },
76+ { tag: "cardTitleArtSubtitleMascotModel", model: cardTitleArtSubtitleMascotModel },
77+ { tag: "cardTitleArtSubtitleModel", model: cardTitleArtSubtitleModel },
78+ { tag: "cardTitleArtModel", model: cardTitleArtModel },
79+ { tag: "cardArtModel", model: cardArtModel },
80+ { tag: "cardTitleModel", model: cardTitleModel },
81+ ];
82+ }
83+
84+ function init() {
85+ wait(1);
86+ }
87+
72− function benchmark_time() {
88+ function benchmark_time(data) {
89+ currentModel = data.model
73 cardRepeater.model = 1
90 cardRepeater.model = 1
74 cardRepeater.model = 0
91 cardRepeater.model = 0
75 }
92 }