Add logging for performance analysis