Skip to content

[WIP] some more performance optimizations #1776

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

Closed
wants to merge 1 commit into from
Closed

Conversation

alexcjohnson
Copy link
Collaborator

Following on #1772 - some more poking around for performance bottlenecks.

just use node.innerHTML. It's fine, really!
result = _context.appendSVG(converted);

if(!result) _context.text(str);
_context.node().innerHTML = convertToSVG(str);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. Does this work in IE?

Copy link
Contributor

Choose a reason for hiding this comment

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

http://caniuse.com/#search=innerHTML

image

Inconclusive. We'll have to try it on Browserstack.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh crap you're right... fails even in IE11

@etpinard
Copy link
Contributor

If this works out, this PR is 🏆

This should get us pretty close to plotly.js working in jsdom out of the box, referencing:

@alexcjohnson
Copy link
Collaborator Author

Alright, I suppose I could write some sort of feature detection to enable or disable this behavior... but I think the better solution (which with any luck will be even faster as well as cross-browser!) will be to just build elements like we do for everything else, rather than building a text string and turning that into elements. Going to give that a shot.

@alexcjohnson alexcjohnson deleted the misc-perf2 branch June 12, 2017 15:12
@alexcjohnson alexcjohnson mentioned this pull request Jun 13, 2017
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.

2 participants