cbaecker opened a new pull request, #278:
URL: https://github.com/apache/casbin-cpp/pull/278

   Slight improvement to logger. Pass arguments as const-ref to prevent copying.
   
   `Enforcer` calls `LogPrint()` in various locations, e.g. in the loop 
iterating the policy. This creates a copy every time.
   
https://github.com/apache/casbin-cpp/blob/0ad64a739bd841099c6dbbae4a1f60d12e6cbc0a/casbin/enforcer.cpp#L104-L105
   
   `LogPrint()` itself passes arguments to an instance of `DefaultLogger`, 
which takes another copy 
   
https://github.com/apache/casbin-cpp/blob/0ad64a739bd841099c6dbbae4a1f60d12e6cbc0a/include/casbin/log/default_logger.h#L22
   
   Internal logger is a no-op and copy elision may help, but i was still able 
to measure slight performance improvement.
   Copies should be avoided unless required, e.g. for asynchronous processing.
   
   This may affect existing implementations of the abstract `Logger`-class.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to