Reply to message «Re: 2html optimization», 
sent 20:14:08 15 June 2011, Wednesday
by Benjamin Fritz:

> Also, I have an item on my TODO list to allow the HTML output to use
> an external CSS file. My goal is that this external file can be
> generated just once and then used over and over, and that by not
> processing the CSS every time additional speed increases will be
> possible. I do not have an ETA on this feature, however; it has mostly
> stalled in the design stage until I find time to work on it again. If
> this is interesting enough I can probably put some other features on
> hold which I had planned on getting to first (automatic font
> detection, and uncopyable regions for things like line number and the
> fold column).
If I am not mistaking, CSS is generated only once for each highlighting in both 
plugins, so I guess it will save almost no time. One thing you can do is to 
make 
a cache that persists across subsequent TOhtml runs like I do (though I end 
with 
file containing CSS items for all unique highlightings of all previous files, 
no 
matter whether they are used in current file or not. It is almost nothing 
compared to <body>, so I don't care), this will save more time for this case.

By the way, I noticed that TOhtml creates links out of things like 
`http://www.rsyslog.com'. My plugin does not (and won't, it will only create 
links for tags). Can this be turned off so that comparison will be more fair?

Original message:
> On Wed, Jun 15, 2011 at 10:37 AM, Ben Fritz <fritzophre...@gmail.com> wrote:
> >> You can also speed it up a little but by using:
> >> 
> >>   let g:html_no_progress = 1
> > 
> > Other options which might speed things up slightly (if their effects
> > are acceptable):
> > 
> > g:html_ignore_folding = 1 or g:html_dynamic_folds = 0 (otherwise Vim
> > scans every line for fold information, twice, before starting the
> > conversion)
> > 
> > g:html_use_encoding = "UTF-8" (or whatever encoding you desire) to
> > avoid Vim needing to determine the encoding to use (probably VERY
> > minor savings, but it can also avoid a conversion on write if the
> > specified encoding matches your 'encoding' setting)
> > 
> > g:html_expand_tabs = 0 (probably very minor savings, but this will
> > prevent Vim from doing processing on tab characters to replace them
> > with spaces; mostly this is useful if you do NOT use line numbers or a
> > fold column in the generated output)
> 
> One more to try, if you don't care about conceal support:
> 
> g:html_ignore_conceal = 1
> 
> This will eliminate at least one check per syntax item, and I suspect
> (but have not verified) that the inner loop for non-concealed items
> (always used with ignore_conceal set) is faster than for concealed
> items. But again, this is probably minor savings. The biggest savings
> will probably be from the html_no_progress option, and from disabling
> syntax highlighting on the generated HTML output.
> 
> I'm interested to learn what you end up with. I thought a few times
> about a use case like this, but decided it was unlikely because TOhtml
> is pretty slow for big files.
> 
> Also note, Zyx has a plugin very similar to 2html, with a slightly
> expanded feature set, several possible output formats, and probably a
> very different implementation. If you do go with a Vim method, you can
> try it out. I don't think there's been very much comparison done
> between the two, it could be faster (or it could be slower, I really
> have no idea).
> 
> http://www.vim.org/scripts/script.php?script_id=3113
> 
> Also, I have an item on my TODO list to allow the HTML output to use
> an external CSS file. My goal is that this external file can be
> generated just once and then used over and over, and that by not
> processing the CSS every time additional speed increases will be
> possible. I do not have an ETA on this feature, however; it has mostly
> stalled in the design stage until I find time to work on it again. If
> this is interesting enough I can probably put some other features on
> hold which I had planned on getting to first (automatic font
> detection, and uncopyable regions for things like line number and the
> fold column).

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to