Skip to content

Improve measureString performance #1199

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

Merged
merged 1 commit into from
Jun 7, 2017
Merged

Conversation

marcotisi
Copy link
Contributor

Create only once a element and use it to measure string.
Remove element if Selectize.count equal 0.

Create only once a <span> element and use it to measure string.
Remove element if Selectize.count equal 0.
@marcotisi
Copy link
Contributor Author

@joallard this is the PR which improve measureString performances integrated in the main source.

@marcotisi
Copy link
Contributor Author

marcotisi commented Jan 25, 2017

Any chance to merge this PR in a short time? @joallard

@@ -2049,6 +2049,11 @@ $.extend(Selectize.prototype, {
self.$control_input.removeData('grow');
self.$input.removeData('selectize');

if (--Selectize.count == 0 && Selectize.$testInput) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this condition does is not immediatly clear

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you break this out in a better descriptively named function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I can break into a function and give some benchmarks in a couple of days.

@joallard
Copy link
Member

Do you have benchmark stats?

@brianreavis brianreavis merged commit 32ee80a into selectize:master Jun 7, 2017
michael-maltsev pushed a commit to michael-maltsev/selectize.js that referenced this pull request Aug 28, 2018
Improve measureString performance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants