borisssmidtCET commented on code in PR #14597:
URL: https://github.com/apache/kafka/pull/14597#discussion_r1415344533


##########
core/src/main/scala/kafka/security/authorizer/AclAuthorizer.scala:
##########
@@ -409,9 +411,13 @@ class AclAuthorizer extends Authorizer with Logging {
                                 principal: String, host: String, op: 
AclOperation, permission: AclPermissionType,
                                 resourceType: ResourceType, patternType: 
PatternType): ArrayBuffer[Set[String]] = {
     val matched = ArrayBuffer[immutable.Set[String]]()
-    for (p <- Set(principal, AclEntry.WildcardPrincipalString);
-         h <- Set(host, AclEntry.WildcardHost);
-         o <- Set(op, AclOperation.ALL)) {
+    val ps = if (principal == AclEntry.WildcardPrincipalString) 
Array(AclEntry.WildcardPrincipalString) else Array(principal, 
AclEntry.WildcardPrincipalString)

Review Comment:
   creating and merging and iterating sets was significant slower then 
iterating arrays. The jvm was not able to optimize this away. 



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to