Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(178)

Issue 4279069: cosmetic speedup to the markdown example (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by felix8a
Modified:
15 years, 4 months ago
Reviewers:
Jasvir
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

the markdown example is noticeably sluggish, even when you're just using arrow keys to move the cursor around. what happens is: every keypress in the textarea sets a 'dirty' flag, and every 250ms, if dirty is true, the textarea is converted to html, whether or not the actual text has changed. so if you hold down an arrow key, you can see the cursor pause its motion every 1/4 second. the slow part is converter.makeHtml(), and I'll dig into that some more, but independent of that, we don't need to redo the text-to-html conversion if the text doesn't changed. this CL does that optimization. (which is an easy optimation that I think is reasonable to expect gadget writers to do, since this type of optimization helps performance outside of Caja too)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M src/com/google/caja/demos/playground/examples/markdown.html View 1 chunk +3 lines, -1 line 1 comment Download

Messages

Total messages: 2
felix8a
15 years, 4 months ago (2011-03-23 05:57:08 UTC) #1
Jasvir
15 years, 4 months ago (2011-03-23 21:34:47 UTC) #2
LGTM

http://codereview.appspot.com/4279069/diff/1/src/com/google/caja/demos/playgr...
File src/com/google/caja/demos/playground/examples/markdown.html (right):

http://codereview.appspot.com/4279069/diff/1/src/com/google/caja/demos/playgr...
src/com/google/caja/demos/playground/examples/markdown.html:1676: valueRendered
= t.value;
nice!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b