Google Cloud Profiler: merge calls invoked via `send`
We have very fine-grained traces in our profiles.
One of the reasons is how we send calls invoked via dynamic dispatch (e.g. via Kernel#send
, so the actual method is selected in the runtime).
As you could see on the screenshot below, there many similar frames rendering the same partial, the only difference is that they are invoked during different requests, and all of them are called via Kernel#send
, so the caller class and the method name are set in the runtime, which adds object_id
-like signatures to them:
It prevents such calls to be grouped in the profiler diagram, if we render the same partial.
It would add a lot of clarity and reduce the noise if we could "merge" them.
One idea could be that we edit the trace and convert #<Class:0x00007f6ecb77b460>#_app_views_layouts_project_html_haml___3698311611987171681_369660
into something like DynamicDispatchClass._app_views_layouts_project_html_haml
(or so).