rstudio / htmltools

Tools for HTML generation and output
https://rstudio.github.io/htmltools/
213 stars 67 forks source link

Improve performance by vectorisation #415

Open mgirlich opened 9 months ago

mgirlich commented 9 months ago

Creating HTML tags and marking text as HTML is pretty slow because it isn't vectorised. It would be great to have vectorised interface for such situations. This would help to improve the performance of rendering big tables with {gt}. In https://github.com/rstudio/gt/pull/1470 I improved the performance of rendering a gt table. There are some more optimisations to be done but now about a quarter of the time is spent in htmltools::tag() and htmltools::HTML().

Overall, I think improving the performance of creating HTML and the rendering would be a great help for gt (and other packages that need to render a bit more HTML).