﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11001	Drag handlers positioning coalescing	xmo	Marek Lewandowski	"Working on a 4.3-based system using widgets, I recently started looking into the performances of starting the editor to see if it'd be possible to speed it up.

In my ""test case"" (a page of the system), CKEDITOR.inline is called on a page section holding 1300 nodes, including 46 would-be widget.

Looking at the Chrome timeline (frames section), I noticed that within CKEDITOR's ""readiness"" handler (a timer in scriptloader), there's a significant sequence of layout recomputations which Chrome marks with a warning (it's a whole-document synchronous operation).

The issue here is that `positionDragHandler` accesses `offsetTop` and `offsetLeft` which requires a valid layout, but the setup of each widget invalidates the layout by setting a bunch classes & attributes on it. Which means the layout must be entirely recomputed during each `positionDragHandler`, aka once per widget.

Coalescing the calls (by setting up a timeout, adding widgets to a queue then running the actual `positionDragHandler` on all widgets at once) saves about 100ms between the call to `CKEDITOR.inline` and the triggering of `instanceReady` (~1400ms -> ~1300ms) on a 15"" 2010 MBP, under Chrome 29. It also makes the timeline significantly cleaner."	Bug	closed	Normal	CKEditor 4.3.2	UI : Widgets		fixed		
