Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Improve measureString performance - #1199

Merged
brianreavis merged 1 commit into
selectize:masterfrom
marcotisi:master
Jun 7, 2017
Merged

brianreavis merged 1 commit into
selectize:masterfrom
marcotisi:master

Conversation

@marcotisi

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@marcotisi

marcotisi commented Jan 25, 2017 •

Copy link
Copy Markdown
Contributor Author

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

Comment thread src/selectize.js
self.$control_input.removeData('grow');
self.$input.removeData('selectize');

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants