Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Improved parseAttributes function performance #1822

Merged
merged 3 commits into from
Feb 6, 2020
Merged

Improved parseAttributes function performance #1822

merged 3 commits into from
Feb 6, 2020

Conversation

mlewand
Copy link
Contributor

@mlewand mlewand commented Feb 5, 2020

Suggested merge commit message (convention)

Other: Improved parseAttributes function performance. This results with improved editor data processing speed. Closes ckeditor/ckeditor5#5854.


Additional information

parseAttributes function suffered a copy'n'pasta from utils' toMap function. It required same adjustment as in ckeditor/ckeditor5-utils#323. Or even better to reuse toMap function, which is what this PR does.

A sub-pr of ckeditor/ckeditor5-utils#323.

The isPlainObject method is pretty slow, and given that elements are created intensively, reducing cost of this brings notable gains.
Also fixed API docs, as the function is supposed to work with Iterables, see the attrs parameter type in view/Element's constructor (https://ckeditor.com/docs/ckeditor5/15.0.0/api/module_engine_view_element-Element.html#function-constructor).
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 56bd240 on i/5854 into 1c3749e on master.

@jodator jodator merged commit ecaf056 into master Feb 6, 2020
@jodator jodator deleted the i/5854 branch February 6, 2020 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants