Skip to content

Use ALTREP safe operations #11

@mitchelloharawild

Description

@mitchelloharawild

For instance, viewing a tibble unnecessarily evaluates the sequences:

library(vecvec)
x <- tibble::tibble(x = vecvec(seq_len(1e6)), y = seq_len(1e6))
pryr::object_size(x$x)
#> 32.90 kB
pryr::object_size(x$y)
#> 680 B
x
#> # A tibble: 1,000,000 × 2
#>    x           y
#>    <int*>  <int>
#>  1       1     1
#>  2       2     2
#>  3       3     3
#>  4       4     4
#>  5       5     5
#>  6       6     6
#>  7       7     7
#>  8       8     8
#>  9       9     9
#> 10      10    10
#> # ℹ 999,990 more rows
pryr::object_size(x$x)
#> 4.03 MB
pryr::object_size(x$y)
#> 680 B

Created on 2026-04-10 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions