redsolver / noteless

A Markdown-based note-taking app for mobile devices.
MIT License
496 stars 44 forks source link

Faster load times #45

Open NomarCub opened 4 years ago

NomarCub commented 4 years ago

Notes, even not particularly long ones take 1-2 or more seconds to load. It's especially jarring that sometimes the screen flashes white after loading. A better load animation might help a little with perception, but I don't know how much. Other markdown apps (ones made with flutter too) take at most 0.5 seconds on my device, and it really feels different.

redsolver commented 4 years ago

None of the apps you listed except Epsilon Notes supports KaTeX or AsciiMath. Also, Epsilon Notes has it turned off by default because of performance reasons. Noteless also supports mhchem and mermaid.

To offer all of this, Noteless currently uses a WebView which makes the process quite slow.

The solution is to render all of this directly in Flutter (like GitJournal does), but this also means you don't have the special rendering stuff like KaTeX and basically get a "just Markdown" version.

Another option is to port all of this rendering libraries to Flutter and Dart and maintain them. Some are already available (https://pub.dev/packages/catex).

emdoe commented 3 years ago

BTW (maybe it's a little bit off topic...), I'm not pretty sure which one would be better, KaTeX or MathJax V3?

redsolver commented 3 years ago

KaTeX claims to be The fastest math typesetting library for the web. on their website

emdoe commented 3 years ago

However, in this page, I found that MathJax V3 may be a little bit faster.

redsolver commented 3 years ago

Just tried the page on my phone, MathJax V3 is a little bit faster there. Noteless however also does some stuff like parsing AsciiMath expressions and converting them to KaTeX expressions, so I don't think it's directly comparable. Also I think switching to MathJax V3 isn't worth the effort.

dmotte commented 3 years ago

Just an advice: you can simply give the user an option to enable/disable KaTeX rendering in the Settings page :wink:

meadows19 commented 3 years ago

Just an advice: you can simply give the user an option to enable/disable KaTeX rendering in the Settings page 😉

This would be a simple solution. Most users will not use the maths functions, so they're no need to slow things down for them unnecessarily.