Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The uid() helper is sluggish and can be improved #6188

Closed
oleq opened this issue Feb 4, 2020 · 0 comments · Fixed by ckeditor/ckeditor5-utils#322
Closed

The uid() helper is sluggish and can be improved #6188

oleq opened this issue Feb 4, 2020 · 0 comments · Fixed by ckeditor/ckeditor5-utils#322
Assignees
Labels
package:utils type:improvement This issue reports a possible enhancement of an existing feature. type:performance This issue reports a performance issue or a possible performance improvement.

Comments

@oleq
Copy link
Member

oleq commented Feb 4, 2020

📝 Provide a description of the improvement

A follow-up of #6161 (comment).

As @Reinmar find out uid() takes a lot of time to execute and is used virtually everywhere in the codebase (collections, emitters).

I tested and 1000000 executions of our current uid() helper takes around 3s to execute

Screenshot 2020-02-04 at 14 59 17

while it can be improved down to 350ms (~10x less, see the PR):

Screenshot 2020-02-04 at 14 59 22


If you'd like to see this improvement implemented, add a 👍 reaction to this post.

@oleq oleq added type:improvement This issue reports a possible enhancement of an existing feature. package:utils type:performance This issue reports a performance issue or a possible performance improvement. labels Feb 4, 2020
@oleq oleq self-assigned this Feb 4, 2020
Reinmar added a commit to ckeditor/ckeditor5-utils that referenced this issue Feb 4, 2020
Other: The `uid()` helper should be a lot faster. Closes ckeditor/ckeditor5#6188.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:utils type:improvement This issue reports a possible enhancement of an existing feature. type:performance This issue reports a performance issue or a possible performance improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant