Debug logging triggers unnecessary JAXB marshaling which leads to a significant performance degradation in several places

Description

org.herasaf.xacml.core.simplePDP.SimplePDP.evaluate, line 161 in 1.0.0-M2 always calls request.toString(), even when debug logging is not enabled.

Fix suggestion: change the statement to:
logger.debug("Evaluating Request: {}", request);

request.toString() will now only be invoked if debug logging is enabled.

In our simple performance test, we were able to reduce the time to evaluate a request from 150ns to 40ns after making this change (on a normal log level).

Environment

n/a

Status

Assignee

Unassigned

Reporter

Walco van Loon

Labels

Time tracking

1h

Components

Fix versions

Affects versions

1.0.0-M2
1.0.0-M1

Priority

Major
Configure