Re: [PHP-DEV] Deferred backtrace generation algorithm.

2025-05-02 Thread Edmond Dantes
Hello Bob. > So you effectively will have to manage a weakmap of next-stack-frame to > exception objects. Yes, that was exactly my first idea — to use a WeakMap from exceptions. Now it seems that copying part of the frame information will use less memory. But that's not certain :) > Of note is

Re: [PHP-DEV] Deferred backtrace generation algorithm.

2025-05-02 Thread Edmond Dantes
Hello, Rob! > For what it is worth, the stack trace is not generated in the constructor (at > least from the perspective of the developer). This is a design feature. In PHP, call frames for PHP functions are stored in a separate stack. However, they are still stored following the stack (LIFO) pr

Re: [PHP-DEV] Deferred backtrace generation algorithm.

2025-05-02 Thread Bob Weinand
Hey Edmond, On 2.5.2025 10:14:37, Edmond Dantes wrote: Good day, everyone. In the neighboring thread Concept: Lightweight error channels, the topic of exception performance was discussed. The main issue is the immediate backtrace generation in the constructor, which can cause up to a 50% perfo

Re: [PHP-DEV] Deferred backtrace generation algorithm.

2025-05-02 Thread Rob Landers
On Fri, May 2, 2025, at 10:14, Edmond Dantes wrote: > Good day, everyone. > > In the neighboring thread Concept: Lightweight error channels, the > topic of exception performance was discussed. > > The main issue is the immediate backtrace generation in the > constructor, which can cause up to a 5

[PHP-DEV] Deferred backtrace generation algorithm.

2025-05-02 Thread Edmond Dantes
Good day, everyone. In the neighboring thread Concept: Lightweight error channels, the topic of exception performance was discussed. The main issue is the immediate backtrace generation in the constructor, which can cause up to a 50% performance loss compared to return (as I understood from the d