You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/04/30 04:11:21 UTC
[james-project] 01/21: [PERF] FetchData should optimize adding single item
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit caf7c02a006fa49400fde002902ee0b140e134ce
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Apr 18 12:00:42 2022 +0700
[PERF] FetchData should optimize adding single item
Varargs does a array copy and a full collection addition.
This takes 30% of FETCH command parsing (and 5% of its
allocated memory) and can easily be improved.
---
.../src/main/java/org/apache/james/imap/api/message/FetchData.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java b/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java
index b096b8dd85..e45303831d 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/message/FetchData.java
@@ -43,6 +43,11 @@ public class FetchData {
private long changedSince = -1;
private boolean vanished;
+ public Builder fetch(Item item) {
+ itemToFetch.add(item);
+ return this;
+ }
+
public Builder fetch(Item... item) {
return fetch(Arrays.asList(item));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org