From dev-return-68072-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Sun Nov 11 19:24:56 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 24DE4180645 for ; Sun, 11 Nov 2018 19:24:55 +0100 (CET) Received: (qmail 89435 invoked by uid 500); 11 Nov 2018 18:24:55 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 89424 invoked by uid 99); 11 Nov 2018 18:24:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Nov 2018 18:24:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BD70E0A32; Sun, 11 Nov 2018 18:24:54 +0000 (UTC) From: franz1981 To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request #2427: ARTEMIS-2170 Optimized CoreMessage's ch... Content-Type: text/plain Message-Id: <20181111182454.1BD70E0A32@git1-us-west.apache.org> Date: Sun, 11 Nov 2018 18:24:54 +0000 (UTC) Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2427#discussion_r232498771 --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java --- @@ -318,6 +320,33 @@ public synchronized boolean containsProperty(final SimpleString key) { } } + public synchronized boolean cleanupInternalProperties(Predicate propertyNamePredicate) { + if (!internalProperties) { --- End diff -- The biggest improvement here is exactly due to the fact that cleaning up properties atomically is a duty of who own the data ie TypedProperties. About the message particulars I do believe that `TypedProperty` already contains some of them: - internal property name prefix ie `TypedProperties.AMQ_PROPNAME` - internal properties presence checks ie `TypedProperties::hasInternalProperties` I have used the `Predicate` to allow decoupling, but I understand your point here: we can move it outer (as it is, algoritmically), but I'm not fully sure that it will bring the same benefit (eg enter/exit synchronize TypedProperty once). Just to give some reason of this change: with this PR it is producing less then 1/4 of the garbage while having more then twice the throughput. ---