Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E74F310098 for ; Tue, 12 Nov 2013 11:03:32 +0000 (UTC) Received: (qmail 13086 invoked by uid 500); 12 Nov 2013 11:03:30 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 13058 invoked by uid 500); 12 Nov 2013 11:03:26 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 13022 invoked by uid 99); 12 Nov 2013 11:03:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Nov 2013 11:03:24 +0000 Date: Tue, 12 Nov 2013 11:03:24 +0000 (UTC) From: "Benoit Wiart (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FLEX-33897) MediaQueryParser should not allocate memory for expressions already cached MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-33897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benoit Wiart updated FLEX-33897: -------------------------------- Attachment: mediaquery-example-1.png > MediaQueryParser should not allocate memory for expressions already cached > -------------------------------------------------------------------------- > > Key: FLEX-33897 > URL: https://issues.apache.org/jira/browse/FLEX-33897 > Project: Apache Flex > Issue Type: Improvement > Components: Mobile: Performance, Styles > Affects Versions: Apache Flex 4.11.0 > Environment: desktop mobile > Reporter: Benoit Wiart > Priority: Minor > Labels: memory, performance > Attachments: mediaquery-example-1.png > > > When using @media from default sdk styles or custom styles > the mxml compiler generates code like : > if (styleManager.acceptMediaList("(application-dpi:160)")) > { > this.focusThickness = 3; > this.fontSize = 24; > } > if (styleManager.acceptMediaList("(application-dpi:320)")) > { > this.fontSize = 24; > } > if (styleManager.acceptMediaList("(application-dpi:480)")) > { > this.focusThickness = 3; > this.fontSize = 24; > } > ... > The acceptMediaList is often called, it delegates to MediaQueryParser which has a cache of known media expressions. > But MediaQueryParser#parse allocates some memory even if the expression is in the cache. these allocations come from the string manipulation. > this patch use the original expression as the key in the cache instead of the 'lowercased' expression. > It will increase the cache size (by a small percentage) only if you have the same media expression in different case. -- This message was sent by Atlassian JIRA (v6.1#6144)