fastavro.schemaless_reader performance loss when profiling is enabled

37 Views Asked by At

I am attempting to profile a Python app that uses the fastavro library.

  1. I am profiling using the Datadog Profiler
  2. I run the application using the command ddtrace-run python -m app.main
  3. I enable the profiler using the environment variable DD_PROFILING_ENABLE=true

This results in the following performance degredation in fastavro.schemaless_reader

  1. With profiler enabled, the average execution time is ~38ms
  2. With profiler disabled, the average is ~6ms

Has anyone else tried to profile the fastavro library and could shine a light on why the profiler is causing such a performance loss?

enter image description here

1

There are 1 best solutions below

0
On

All code is going to have performance loss while profiling. Profiling introduces overhead to keep track of the different metrics. While profiling, it's less important to see how long the overall execution takes and more important to look at how long individual parts of the execution take relative to others.