Skip to content

Nigh infinite ActiveSupport::Notifications::Event objects #2

@buermann

Description

@buermann

Grape::Middleware::Lograge has a before hook that subscribes to ActiveSupport::Notifications.subscribe('sql.active_record') in which a new ActiveSupport::Notifications::Event object is created every time the event fires, presumably one for every database query, which runs up ruby's garbage collection and object allocations enormously. All the Event object does is calculate "1000.0 * (ending - start)", and doesn't seem necessary at all.

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