graphql-ruby
graphql-ruby copied to clipboard
Refactor Language::Nodes::AbstractNode#initialize
It uses keyword arguments which requires Ruby to allocate a Hash. (This is only for .new -> #initialize.) See https://github.com/rmosolgo/graphql-ruby/pull/4718#issuecomment-1850644710
If I can get this and this landed in Ruby 3.4, it will eliminate the hash allocation. If you like the kwargs, keep them! 😄
Wow, that would be great. I'll keep an eye on those PRs, thanks!
One of the two linked PRs to Ruby is merged... 🤞
👋 Hey @tenderlove, are you still considering that PR to do Class#new in Ruby? I'm gearing up for GraphQL-Ruby 3.0 and I'll roll this breaking change to #initialize if necessary.
👋 Hey @tenderlove, are you still considering that PR to do
Class#newin Ruby? I'm gearing up for GraphQL-Ruby 3.0 and I'll roll this breaking change to#initializeif necessary.
I am, but there's been some blockers so I don't think I'll be able to get this merged until next year maybe. 😭
Please do what you think is best for GraphQL-Ruby and don't wait on me. I think we'll eventually get Ruby changed upstream, but it's going to take more time.
I was able to land an optimization to Class.new for Ruby 3.5, so I'm not sure of this is relevant anymore. IOW it's probably fine to leave the kwargs :)
That's great to hear. Thanks for improving Ruby ... and for updating me!