ppkarwasz commented on PR #2550: URL: https://github.com/apache/logging-log4j2/pull/2550#issuecomment-2288089783
> > While the difference between `remove()` and `set(null)` is almost imperceptible in a classical threading model, when virtual threads are used the difference **MIGHT BE** considerable. > > This PR removes 94 and adds 425 LoC. Have we evaluated the assumption using benchmarks? It might be true that we will be shaving off some bytes from the thread stack, but aren't we also introducing an extra overhead since TLs need to be allocated again and again each time? I ran some benchmarks a while ago. While I don't remember the numbers, the overhead due to TL deletion and creation was statistically significant. The removal of TLs for the `ThreadContextMap` implementations should have an insignificant on performance, since the map should only become empty at the bottom of the call stack. Anyway we can fix this problem if users report an issue. I am closing this PR. -- 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]
