Skip to content

Commit

Permalink
Introduced init-single.html manual test to test just one run of one…
Browse files Browse the repository at this point in the history
… data set, without all tooling around it.
  • Loading branch information
scofalik committed Oct 2, 2024
1 parent 144d488 commit d45a814
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/manual/performance/2024/init-single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' https://ckeditor.com 'unsafe-inline' 'unsafe-eval'">
<!-- For a totally unknown reason, Travis and Vimeo do not like each other and the test fail on CI. -->
<meta name="x-cke-crawler-ignore-patterns" content='{
"request-failure": "vimeo.com",
"response-failure": "vimeo.com",
"console-error": [ "<svg> attribute preserveAspectRatio", "vimeo.com" ]
}'>
</head>

<div id="editor"></div>
27 changes: 27 additions & 0 deletions tests/manual/performance/2024/init-single.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals console, window, document */

import config from './config';
import allDataSets from './data/generated/index.js';
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor.js';

const initialData = allDataSets.paragraphs();
const finalConfig = { initialData, ...config };
const editorElement = document.querySelector( '#editor' );

const startTime = window.performance.now();

ClassicEditor
.create( editorElement, finalConfig )
.then( () => {
const testTime = window.performance.now() - startTime;

console.log( testTime );
} )
.catch( err => {
console.error( err.stack );
} );
17 changes: 17 additions & 0 deletions tests/manual/performance/2024/init-single.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Performance: Editor init time

**! Test with console off, in incognito mode !**

This performance test measures how long editor initializes for various kinds of documents. Each data set presents a "heavy" document case, which takes substantial amount of time to load.

The test starts automatically after you open this page.

By default, the test goes through all data sets and performs 10 tries for each. Default run will take around 10 minutes. You can narrow it down using the test config in test source.

The status message will inform you about current progress.

After each single editor initialization, the initialization time is stored and the page is refreshed, until the whole suite is done.

After all tests are done, the results will be inserted into the clipboard, in a format that can be directly pasted to a spreadsheet. Allow the browser to use the clipboard when prompted. Results are also displayed in the console.

Between test runs, data is stored in `SessionStorage`. Close the tab to finish and "reset" the test run before it ended.

0 comments on commit d45a814

Please sign in to comment.