geronimo-xbean-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <j...@apache.org>
Subject [jira] [Created] (XBEAN-274) Xbean finder is slow because of String.replaceFirst
Date Tue, 07 Oct 2014 06:44:33 GMT
Mark Struberg created XBEAN-274:
-----------------------------------

             Summary: Xbean finder is slow because of String.replaceFirst
                 Key: XBEAN-274
                 URL: https://issues.apache.org/jira/browse/XBEAN-274
             Project: XBean
          Issue Type: Bug
          Components: finder
    Affects Versions: 4.0
            Reporter: Mark Struberg
            Assignee: Mark Struberg
             Fix For: 4.1


JarArchive uses entry.getName().replaceFirst(".class$", "");

This is effectively a replacement of the last ".class" in the entry name.
This is pretty slow as replaceFirst internally creates a PatternMatcher.
By replacing this line with an endsWith + substring I ended up with 20% performance boost.

Overall in a real world application my OpenWebBeans boot time went down from 1020ms to 969ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message