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

[Proposal] Partial rendering #47

Closed
schickling opened this issue Jul 22, 2013 · 17 comments
Closed

[Proposal] Partial rendering #47

schickling opened this issue Jul 22, 2013 · 17 comments

Comments

@schickling
Copy link

When working on big documents (with MathJax) and having lazy rendering disabled it happens that the rendering becomes kinda slow. (I know you might be arguing that I should enable lazy rendering, but the rendering process is the same).

My idea to speed up and improve this situation you could try to render just parts of the document. How you split up the document would be the biggest problem imo. Suppose you have split up the document in four parts and you currently edit the second part (realtime collaboration needs special treatment) just the second part of the document should be refreshed.

I think that could drastically speed up the document rendering while working on the document. I'd like to hear your thoughts on that.

PS: This "issue" is just an improvement idea, nothing what has to be done immediately. 🐹

@vanabel
Copy link

vanabel commented Jul 23, 2013

Just like I mentioned in #42 , also I provided another solution there.

@benweet
Copy link
Owner

benweet commented Jul 28, 2013

@schickling @vanabel I just commited a new "partial rendering" extension that renders only modified sections (delimited by titles). Can you give me your feedback?
Note: If you modify a link definition or a footnote, it will re-render all the document.

@schickling
Copy link
Author

Tested it a little for now and seems to work as I imagined. Great work again! 👍

@benweet
Copy link
Owner

benweet commented Jul 28, 2013

By the way you can compare the rendering time by using this UserCustom extension:

userCustom.onPreviewFinished = function() { 
    console.log("Preview time: " + (new Date() - extensionMgr.previewStartTime));
};

You should see logs in the JavaScript console.

@benweet
Copy link
Owner

benweet commented Jul 28, 2013

Actually this one is more interesting:

userCustom.onAsyncPreview = function(callback) {
    console.log("Conversion time: " + (new Date() - extensionMgr.previewStartTime));
    callback();
};
userCustom.onPreviewFinished = function() { 
    console.log("Preview time: " + (new Date() - extensionMgr.previewStartTime));
};

It gives you:

  1. Markdown conversion time (the synchronous part)
  2. Total rendering time including MathJax asynchronous typeset

@schickling
Copy link
Author

I'll try it these days!

@vanabel
Copy link

vanabel commented Jul 29, 2013

Can't even render if you have create a new document, and type anything in it.
But if you refresh the page, it will start to render!

@vanabel
Copy link

vanabel commented Jul 29, 2013

It works for mathjax render, which will render at each section of h title, but why not only at the editing paragraph?

@benweet
Copy link
Owner

benweet commented Jul 29, 2013

@vanabel Do you have any error logs in the JavaScript console that I can investigate?

Can you try:

  1. Reset StackEdit settings
  2. If it doesn't help, delete the application cache (Chome settings->Show advanced settings->Content settings->All cookies and site data->benweet.github.io->Application cache)

@vanabel
Copy link

vanabel commented Jul 29, 2013

It's normal after I delete the cookies, but you didn't tell me that will empty all my settings, including the document selector...

@benweet
Copy link
Owner

benweet commented Jul 29, 2013

Normally, you can delete application cache (which contains StackEdit's pages) and/or local storage (which contains StackEdit's markdown documents). You probably deleted both of them.

@vanabel
Copy link

vanabel commented Jul 31, 2013

The can't render initially problem still exists!

@benweet
Copy link
Owner

benweet commented Jul 31, 2013

Does it appear on all your documents or only on a specific one? If so, please provide an example. Can you check if you have errors in the JavaScript console?

@schickling
Copy link
Author

The can't render initially problem still exists!

Same here if I create a new document and start to edit.

@vanabel
Copy link

vanabel commented Jul 31, 2013

For every new doc, it can't render initially. The JS console:

Document was loaded from Application Cache with manifest http://benweet.github.io/stackedit/cache.manifest benweet.github.io:1
Application Cache Checking event benweet.github.io:1
Application Cache NoUpdate event benweet.github.io:1
Port error: Could not establish connection. Receiving end does not exist. miscellaneous_bindings:236
chromeHidden.Port.dispatchOnDisconnect miscellaneous_bindings:236
Failed to load resource 

@benweet
Copy link
Owner

benweet commented Jul 31, 2013

I just reproduced the problem. It happens when document is empty. It should be fixed now.

@schickling
Copy link
Author

I can confirm that 👍

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

3 participants