-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Massive performance degragation 3.0 -> 3.0.2 #140
Comments
@hsbt any idea? |
I will look at next week. |
@mscrivo do you see the same without YJIT? How does 3.3.4 behave? |
Ah I misspoke, we're already using 3.3.4. I'll have to put together a test with the new version and YJIT disabled, or try and see if I can repro on my dev machine. Will let you know if I have anything interesting to share on that front. |
Just chiming in that we also have this problem with |
I've noticed the same issue within Grape which depends on
You can execute a complete memory profiler from this script require 'grape'
require 'memory_profiler'
class API < Grape::API
default_format :json
params do
requires :name, allow_blank: false
end
get '/disallow_blank'
params do
optional :name, type: String, allow_blank: false
end
get '/opt_disallow_string_blank'
params do
optional :name, allow_blank: false
end
get '/disallow_blank_optional_param'
params do
requires :name, allow_blank: true
end
get '/allow_blank'
params do
requires :val, type: DateTime, allow_blank: true
end
get '/allow_datetime_blank'
params do
requires :val, type: DateTime, allow_blank: false
end
get '/disallow_datetime_blank'
params do
requires :val, type: DateTime
end
get '/default_allow_datetime_blank'
params do
requires :val, type: Date, allow_blank: true
end
get '/allow_date_blank'
params do
requires :val, type: Integer, allow_blank: true
end
get '/allow_integer_blank'
params do
requires :val, type: Float, allow_blank: true
end
get '/allow_float_blank'
params do
requires :val, type: Integer, allow_blank: true
end
get '/allow_integer_blank'
params do
requires :val, type: Symbol, allow_blank: true
end
get '/allow_symbol_blank'
params do
requires :val, type: Grape::API::Boolean, allow_blank: true
end
get '/allow_boolean_blank'
params do
requires :val, type: Grape::API::Boolean, allow_blank: false
end
get '/disallow_boolean_blank'
params do
optional :user, type: Hash do
requires :name, allow_blank: false
end
end
get '/disallow_blank_required_param_in_an_optional_group'
params do
optional :user, type: Hash do
requires :name, type: Date, allow_blank: true
end
end
get '/allow_blank_date_param_in_an_optional_group'
params do
optional :user, type: Hash do
optional :name, allow_blank: false
requires :age
end
end
get '/disallow_blank_optional_param_in_an_optional_group'
params do
requires :user, type: Hash do
requires :name, allow_blank: false
end
end
get '/disallow_blank_required_param_in_a_required_group'
params do
requires :user, type: Hash do
requires :name, allow_blank: false
end
end
get '/disallow_string_value_in_a_required_hash_group'
params do
requires :user, type: Hash do
optional :name, allow_blank: false
end
end
get '/disallow_blank_optional_param_in_a_required_group'
params do
optional :user, type: Hash do
optional :name, allow_blank: false
end
end
get '/disallow_string_value_in_an_optional_hash_group'
resources :custom_message do
params do
requires :name, allow_blank: { value: false, message: 'has no value' }
end
get
params do
optional :name, allow_blank: { value: false, message: 'has no value' }
end
get '/disallow_blank_optional_param'
params do
requires :name, allow_blank: true
end
get '/allow_blank'
params do
requires :val, type: DateTime, allow_blank: true
end
get '/allow_datetime_blank'
params do
requires :val, type: DateTime, allow_blank: { value: false, message: 'has no value' }
end
get '/disallow_datetime_blank'
params do
requires :val, type: DateTime
end
get '/default_allow_datetime_blank'
params do
requires :val, type: Date, allow_blank: true
end
get '/allow_date_blank'
params do
requires :val, type: Integer, allow_blank: true
end
get '/allow_integer_blank'
params do
requires :val, type: Float, allow_blank: true
end
get '/allow_float_blank'
params do
requires :val, type: Integer, allow_blank: true
end
get '/allow_integer_blank'
params do
requires :val, type: Symbol, allow_blank: true
end
get '/allow_symbol_blank'
params do
requires :val, type: Grape::API::Boolean, allow_blank: true
end
get '/allow_boolean_blank'
params do
requires :val, type: Grape::API::Boolean, allow_blank: { value: false, message: 'has no value' }
end
get '/disallow_boolean_blank'
params do
optional :user, type: Hash do
requires :name, allow_blank: { value: false, message: 'has no value' }
end
end
get '/disallow_blank_required_param_in_an_optional_group'
params do
optional :user, type: Hash do
requires :name, type: Date, allow_blank: true
end
end
get '/allow_blank_date_param_in_an_optional_group'
params do
optional :user, type: Hash do
optional :name, allow_blank: { value: false, message: 'has no value' }
requires :age
end
end
get '/disallow_blank_optional_param_in_an_optional_group'
params do
requires :user, type: Hash do
requires :name, allow_blank: { value: false, message: 'has no value' }
end
end
get '/disallow_blank_required_param_in_a_required_group'
params do
requires :user, type: Hash do
requires :name, allow_blank: { value: false, message: 'has no value' }
end
end
get '/disallow_string_value_in_a_required_hash_group'
params do
requires :user, type: Hash do
optional :name, allow_blank: { value: false, message: 'has no value' }
end
end
get '/disallow_blank_optional_param_in_a_required_group'
params do
optional :user, type: Hash do
optional :name, allow_blank: { value: false, message: 'has no value' }
end
end
get '/disallow_string_value_in_an_optional_hash_group'
end
end
report = MemoryProfiler.report do
API.compile!
end
report.pretty_print |
Anyone in this thread that want this fixed please help at #141 (comment) |
v3.0.3 released with fix, please report back if it has resolved your issues! |
It resolved our issue :) |
After upgrading from 3.0 to 3.0.2, we notice crashes during startup in our test environment. The pods were using an order of magnitude more CPU on startup than before. Upon profiling, we saw this:
and this is what our CPU usage looked like before, after upgrade, and after reverting:
We don't use mustermann explicitly, just implicitly via usage of sinatra.
Some notes about our env:
Ruby 3.3.3 with YJIT enabled running in x64 docker image
latest Sinatra + Puma versions
The text was updated successfully, but these errors were encountered: