Skip to content

Improve performance and memory for tagWrite() #413

@mgirlich

Description

@mgirlich

Printing a bigger gt table is very slow and consumes a lot of memory. Part of this need to be addressed in {gt} but another big part is the tagWrite() function. It would be great to improve the performance.

Example

profvis::profvis(
  ggplot2::diamonds %>% 
    gt::gt() %>% 
    print()
)

image

It also seems that the memory consumption grows more than linear

profvis::profvis({print_diamonds(4e3)})
#  28.6 MB in `renderTags()`
profvis::profvis({print_diamonds(8e3)})
#  103 MB in `renderTags()`
profvis::profvis({print_diamonds(16e3)})
#  346.9 MB in `renderTags()`

There are multiple things that need to be improved

  • the textWriter is slow and memory hungry
  • takeSingleton()
  • takeHeads()
  • findDependencies()
  • tagify()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions