commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CODEC-174) Improve performance of Beider Morse encoder
Date Sun, 17 Nov 2013 21:17:21 GMT

    [ https://issues.apache.org/jira/browse/CODEC-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13824957#comment-13824957
] 

Thomas Neidhart commented on CODEC-174:
---------------------------------------

In r1542823, I fixed the Clirr error by re-introducing the original method signature, renaming
the new methods to "Map getInstanceMap(....)" and mapping getInstance to them by joining the
values.

I would further suggest to change the rule cache from a Map<String, List<Rule> to
a Map<Character, List<Rule>> and work with charAt, which should bring a little
bit of extra performance and would be more clear, as the cache only considers the first character
of the rule pattern.

> Improve performance of Beider Morse encoder
> -------------------------------------------
>
>                 Key: CODEC-174
>                 URL: https://issues.apache.org/jira/browse/CODEC-174
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.6, 1.7
>            Reporter: Thomas Champagne
>              Labels: patch, performance
>         Attachments: CODEC-174-change-rules-storage-to-Map.patch, CODEC-174-convert-set-to-list-in-apply-method.patch,
CODEC-174-delete-subsequence-cache-and-use-String.patch, CODEC-174-delete-subsequence-cache.patch,
CODEC-174-refactor-join-method-in-Phoneme.patch, CODEC-174-refactor-restrictTo-method-in-SomeLanguages.patch,
CODEC-174-reuse-set-in-PhonemeBuilder.patch, CODEC_174_cleanup.patch, TestCacheSubSequence.java,
test-commons-codec-test-bm.zip
>
>
> I use Beider Morse encoder with Solr. When it indexes a lot of documents using this encoder,
the import time is multiplied by 30. So, I have decided to optimize the current implementation
in the commons-codec.
> Currently, I have created two patch. The first patch delete a "performance hack" about
a subsequence cache. This cache doesn't optimize performance and after deleting it, you can
win some milliseconds.
> The second patch changes the storage of the rules in memory using a Map instead of List.
With it, you can access to a rule directly with the beginning of pattern. This patch divide
the encoding time by 2.
> I will try to find more improvement. If you have any idea, please tell me it.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message