Skip to content

Bug - Alt rep string objects materialization in rstudio IDE #4171

@traversc

Description

@traversc

I posted this on r-devel, but got no response. Since it's an issue that mostly affects rstudio, I thought I'd post it here.

I have a toy alt-rep string package that generates randomly seeded strings.

In R command line it works fine:

example:
library(altstringisode)
x <- altrandomStrings(1e8)
head(x)
[1] "2PN0bdwPY7CA8M06zVKEkhHgZVgtV1" "5PN2qmWqBlQ9wQj99nsQzldVI5ZuGX" ... etc

In Rstudio, I think Rstudio calls object_size or Object.size? At any rate, on instantiation, the set_altstring_Elt_method is called for all elements 1 through 1e8 which forces materializing (slowly) of every element of the vector.

This is a problem since the purpose of alt-rep is to defer evaluation until necessary.

System details

RStudio Edition : Any
RStudio Version : Any
OS Version      : Any
R Version       :  3.5+

Steps to reproduce the problem

Make an alt rep string object

Describe the problem in detail

See above

Describe the behavior you expected

Rstudio shouldn't force evaluation of alt rep string objects and possibly other alt-rep types

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions