• Yorick Peterse's avatar
    Reduce instrumentation overhead · 905f8d76
    Yorick Peterse authored
    This reduces the overhead of the method instrumentation code primarily
    by reducing the number of method calls. There are also some other small
    optimisations such as not casting timing values to Floats (there's no
    particular need for this), using Symbols for method call metric names,
    and reducing the number of Hash lookups for instrumented methods.
    
    The exact impact depends on the code being executed. For example, for a
    method that's only called once the difference won't be very noticeable.
    However, for methods that are called many times the difference can be
    more significant.
    
    For example, the loading time of a large commit
    (nrclark/dummy_project@81ebdea5df2fb42e59257cb3eaad671a5c53ca36)
    was reduced from around 19 seconds to around 15 seconds using these
    changes.
    905f8d76
metrics.rb 3.99 KB