You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2019/12/31 22:56:43 UTC
[GitHub] [logging-log4j2] carterkozak opened a new pull request #329:
ThrowableProxy pre-warms its cache using the detected stack
carterkozak opened a new pull request #329: ThrowableProxy pre-warms its cache using the detected stack
URL: https://github.com/apache/logging-log4j2/pull/329
This allows us to avoid class loading even when order doesn't match
the stack due to exceptions caught and pased from a slightly different
codepath.
This change also includes a name-based predicate to avoid loading
classes types which are known not to provide location information.
Unfortunately this mostly invalidates our existing benchmarks which are
based on dynamic proxies, but modern java applications use proxies
and lambdas heavily enough that I expect a sizable performance
improvement.
In a future commit we may consider relying exclusively on classes from
the detected stack for location information and entirely avoid
class loading.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [logging-log4j2] carterkozak commented on a change in pull request
#329: ThrowableProxy pre-warms its cache using the detected stack
Posted by GitBox <gi...@apache.org>.
carterkozak commented on a change in pull request #329: ThrowableProxy pre-warms its cache using the detected stack
URL: https://github.com/apache/logging-log4j2/pull/329#discussion_r362289863
##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyHelper.java
##########
@@ -96,34 +99,46 @@ private CacheEntry(final ExtendedClassInfo element, final ClassLoader loader) {
// and its implementation. The Throwable might also contain stack entries that are no longer
// present as those methods have returned.
Review comment:
This comment should move to `createCacheFromStack`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [logging-log4j2] carterkozak commented on issue #329:
ThrowableProxy pre-warms its cache using the detected stack
Posted by GitBox <gi...@apache.org>.
carterkozak commented on issue #329: ThrowableProxy pre-warms its cache using the detected stack
URL: https://github.com/apache/logging-log4j2/pull/329#issuecomment-570002929
I need to think about this longer before I'm comfortable with it. Posted for early feedback on the idea.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [logging-log4j2] carterkozak commented on a change in pull request
#329: ThrowableProxy pre-warms its cache using the detected stack
Posted by GitBox <gi...@apache.org>.
carterkozak commented on a change in pull request #329: ThrowableProxy pre-warms its cache using the detected stack
URL: https://github.com/apache/logging-log4j2/pull/329#discussion_r362290037
##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java
##########
@@ -104,8 +104,8 @@ public ThrowableProxy(final Throwable throwable) {
this.name = throwable.getClass().getName();
this.message = throwable.getMessage();
this.localizedMessage = throwable.getLocalizedMessage();
- final Map<String, ThrowableProxyHelper.CacheEntry> map = new HashMap<>();
final Stack<Class<?>> stack = StackLocatorUtil.getCurrentStackTrace();
Review comment:
Note (unrelated to this commit): This doesn't quite work when we use the AsyncLoggerContextSelector because ThrowableProxy instances are created lazily on the background thread, where the current stack isn't helpful.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services