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

performance of rendering preview with different frameworks #2490

Closed
karlmikko opened this issue Mar 23, 2014 · 9 comments
Closed

performance of rendering preview with different frameworks #2490

karlmikko opened this issue Mar 23, 2014 · 9 comments

Comments

@karlmikko
Copy link
Contributor

No description provided.

@karlmikko
Copy link
Contributor Author

@taras I don't know how relevant that test is also as the editor isn't usually changing 100+ elements at once. I don't know how HTMLBars is rendering but if it re-draws the entire preview each time it may have issues when getting large documents.

As always, the only true test is using the actual code and benchmarking that.

@karlmikko
Copy link
Contributor Author

@taras just did a quick change to the code to run 10000 instead of 100 and react was the fastest framework

@zchrykng
Copy link

Just my two cents, but this does not seem like a "issue" for Ghost.

Not the place to behaving a bench marking/framework evaluation discussion since the decision has been made.

@wycats
Copy link

wycats commented Mar 24, 2014

I don't know how HTMLBars is rendering but if it re-draws the entire preview each time it may have issues when getting large documents.

Neither Ember (today) nor Ember with HTMLBars updates entire components or pages on every change. React diffs to figure out what to update; Ember uses .get/.set to know what exactly has changed and only update that part of the DOM.

@karlmikko
Copy link
Contributor Author

@wycats I realise ember uses .get/.set backbone did the same thing. The issue as I see it is that the entire markdown document is being re-rendered on change (typing) in the editor, as the content of the post is one .set.

reactjs is a bit different in that it compares the changes to the entire DOM that changed. So if the markdown creates 1 change in a

then only that

will be updated. So it is less DOM write, less re-draw, less calculation.

@zchrykng that is why I raised this issue, more of a discussion, as it isn't about framework performance in general but specifically the editor preview pane as I thought react may be able to help when editing very large posts (over 2000 words).

@karlmikko
Copy link
Contributor Author

I recall there being an issue where photos flickered in the editor/preview while typing - this is caused from the entire preview being re-drawn

@karlmikko
Copy link
Contributor Author

#1031 is the issue i was referring to

@ErisDS
Copy link
Member

ErisDS commented Mar 24, 2014

@KingKarl85 When I asked you to move the conversation to a separate issue (because you were spamming a lot of people with unrelated content) I did expect you to do this as per the contributing guidelines. Raising a completely empty issue is not acceptable.

I appreciate your enthusiasm and the effort to investigate solutions to the editor redraw problem however unless you provide your code and benchmarking results here on the issue, all you're doing is making vague statements about something no one else can see or verify. The current editor does redraw the entire markdown preview - this is nothing to do with Ember - the entire admin is being rewritten in ember on a different branch.

I'm going to close this until such time as it the problems I've mentioned with this issue are resolved - please do not raise a new issue, if this one is updated I will consider reopening it.

@ErisDS ErisDS closed this as completed Mar 24, 2014
karlmikko added a commit to karlmikko/Ghost that referenced this issue Mar 24, 2014
initial test with react taking the markdown generated html to do
caparison update.
@karlmikko
Copy link
Contributor Author

From my initial test with the commit above and a post of 4000+ words.

Images break the react parser. Also there is significant lag with generating the html from Showdown, in which case react won't really help speed things up very much at all.

I think it is a good idea to keep this issue closed. It may be worth looking at different ways of compiling the markdown to speed it up and only update the part being edited while typing.

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

No branches or pull requests

4 participants