You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/07/01 08:59:21 UTC

[GitHub] [james-project] chibenwa opened a new pull request #518: [PERFORMANCE] Another round of minor performance enhancements

chibenwa opened a new pull request #518:
URL: https://github.com/apache/james-project/pull/518


   


-- 
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: notifications-unsubscribe@james.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa merged pull request #518: [PERFORMANCE] Another round of minor performance enhancements

Posted by GitBox <gi...@apache.org>.
chibenwa merged pull request #518:
URL: https://github.com/apache/james-project/pull/518


   


-- 
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: notifications-unsubscribe@james.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on pull request #518: [PERFORMANCE] Another round of minor performance enhancements

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #518:
URL: https://github.com/apache/james-project/pull/518#issuecomment-874398818


   Just squashed


-- 
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: notifications-unsubscribe@james.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on pull request #518: [PERFORMANCE] Another round of minor performance enhancements

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #518:
URL: https://github.com/apache/james-project/pull/518#issuecomment-874398818


   Just squashed


-- 
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: notifications-unsubscribe@james.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] vttranlina commented on a change in pull request #518: [PERFORMANCE] Another round of minor performance enhancements

Posted by GitBox <gi...@apache.org>.
vttranlina commented on a change in pull request #518:
URL: https://github.com/apache/james-project/pull/518#discussion_r662680021



##########
File path: server/protocols/jmap/src/main/java/org/apache/james/jmap/VersionParser.java
##########
@@ -47,37 +52,34 @@ public VersionParser(Set<Version> supportedVersions, JMAPConfiguration jmapConfi
         Preconditions.checkArgument(supportedVersions.contains(jmapConfiguration.getDefaultVersion()),
                 "%s is not a supported JMAP version", jmapConfiguration);
 
-        this.supportedVersions = supportedVersions;
+        this.supportedVersions = supportedVersions.stream()
+            .collect(Guavate.toImmutableMap(version -> version.asString().toLowerCase(Locale.US)));

Review comment:
       Why we convert Set to Map, and key still is `version.asString`?
   is it only makes sense when `Version` object has more than one property?




-- 
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: notifications-unsubscribe@james.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a change in pull request #518: [PERFORMANCE] Another round of minor performance enhancements

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #518:
URL: https://github.com/apache/james-project/pull/518#discussion_r662685481



##########
File path: server/protocols/jmap/src/main/java/org/apache/james/jmap/VersionParser.java
##########
@@ -47,37 +52,34 @@ public VersionParser(Set<Version> supportedVersions, JMAPConfiguration jmapConfi
         Preconditions.checkArgument(supportedVersions.contains(jmapConfiguration.getDefaultVersion()),
                 "%s is not a supported JMAP version", jmapConfiguration);
 
-        this.supportedVersions = supportedVersions;
+        this.supportedVersions = supportedVersions.stream()
+            .collect(Guavate.toImmutableMap(version -> version.asString().toLowerCase(Locale.US)));

Review comment:
       Lookup in a map is O(1) - globally, lookup in a set iterating elements is O(n).
   
   Also initiating the pipeline is quite expensive - we do execute it on each JMAP request so quite often... 




-- 
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: notifications-unsubscribe@james.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org