You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by GitBox <gi...@apache.org> on 2022/04/20 09:01:29 UTC

[GitHub] [wicket] theigl commented on a diff in pull request #514: Avoid generating so many synthetic closing tags.

theigl commented on code in PR #514:
URL: https://github.com/apache/wicket/pull/514#discussion_r853900058


##########
wicket-core/src/main/java/org/apache/wicket/markup/ComponentTag.java:
##########
@@ -126,6 +127,8 @@ public class ComponentTag extends MarkupElement
 
 	private IAutoComponentFactory autoComponentFactory;
 
+	private static final Map<String,AppendingStringBuffer> tagMap = new ConcurrentHashMap<>();

Review Comment:
   I feel a bit uneasy about using an unbounded map. Since Wicket might be used to parse arbitrary XML, we have no way of knowing how many distinct tags users may have in their application. This will probably be fine for 99.9% of use cases, but it might cause issues for some users.
   
   Possible alternatives: 
   
   - Create a cache map of all known HTML5 tags
   - Use a bounded map. We currently only seem to have a `MostRecentlyUsedMap`, that is not thread-safe.
   
   Does anyone else have better ideas?
   
   I'm very interested in this optimization because GC pressure under high load is the main problem in our application.



-- 
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: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org