Procházet zdrojové kódy

Reduce memory consumption of the debug_backtrace call

Since the code does not need neither the 'object' not 'args' keys from backtrace, we can save some memory by not requesting them.

I have a better idea planned too: first attempt getting the trace with limited back trace (limit to only about 5 results), and get the full one only if those were not enough
dracony před 10 roky
rodič
revize
cf2faeb3b7
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/Monolog/Processor/IntrospectionProcessor.php

+ 1 - 1
src/Monolog/Processor/IntrospectionProcessor.php

@@ -52,7 +52,7 @@ class IntrospectionProcessor
             return $record;
             return $record;
         }
         }
 
 
-        $trace = debug_backtrace();
+        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
 
 
         // skip first since it's always the current method
         // skip first since it's always the current method
         array_shift($trace);
         array_shift($trace);