Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beginTrace/endTrace optimization #343

Open
conwaydalej opened this issue Apr 7, 2020 · 3 comments
Open

beginTrace/endTrace optimization #343

conwaydalej opened this issue Apr 7, 2020 · 3 comments

Comments

@conwaydalej
Copy link

There seems to be a lot of code called in beginTrace for no reason, when debugging is turned off. That's assuming I'm not missing anything,

But even with debugging turned off, debug_backtrace and other functions are called regardless, if debugging/logging is on or off. Would it make sense for this to be a simple bool check wrapped around the begin and end trace.

Is this really needed in production, I've found it useful, especially with pgt issues, but I wonder if there are other methods that would prove more useful?

@conwaydalej conwaydalej changed the title beginTrace/endTrace beginTrace/endTrace optimization Apr 7, 2020
@phy25
Copy link
Member

phy25 commented Apr 8, 2020

Well even in production there are people who wants to log all auth-related actions, but I agree that for unknown reason, this is quite messed with too detailed debugging information for the log.

Probably putting a switch at the beginning of those trace-related functions (traceBegin / traceEnd) might help.

@jfritschi
Copy link
Contributor

This is related to #57. The current "logging" was done simply for full debugging at a very early stage. Nobody ever looked at performance or practical issues like normal operational logging requirements.
We should really consider rewriting this to have a proper logging setup with log levels etc.

Looking at your specific proposal I'm not sure how much performance is improved when using variables.... To really speed up we should use leverage constants so that the optimizer can really remove code instead of going through many switches/ifs. Not sure about the best way in php though....

@ParhamG
Copy link

ParhamG commented May 7, 2020

+1 for log levels. Unless I am missing something? I am not seeing an option to enable logging for errors only. It does not make sense to have a detailed log for every normal request on production, but we need errors logged regardless of debug mode being on/off. Also having the option to log to the default PHP log destination, with the stack trace all as a single message would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants