Skip to content

Conversation

@headius
Copy link
Member

@headius headius commented Jun 20, 2024

This PR will replace the remaining uses of the Variable collections returned by methods like InstanceVariables.getInstanceVariableList so we can start deprecating those interfaces and fix users in the wild.

  • getInstanceVariableList replaced with forEachInstanceVariable, eliminating a transient Map of Variable objects.
  • getInstanceVariableNameList replaced with forEachInstanceVariableName, eliminating a transient List<String>.

Most of these do allocate a stateful Lambda, but I've made efforts to keep that cost to a minimum.

headius added 2 commits June 20, 2024 02:38
The getInstanceVariableNameList doesn't create extra Variable
objects, but it does create a list that's usually just iterated
and discarded. We can do it a bit cheaper with a forEach.
@headius headius added this to the JRuby 10.0.0.0 milestone Jun 20, 2024
@headius headius merged commit 477065d into jruby:9.5-dev Jun 24, 2024
@headius headius deleted the more_ivar_optimization branch June 24, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant