Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4DBEB90A7 for ; Fri, 30 Mar 2012 09:23:01 +0000 (UTC) Received: (qmail 24746 invoked by uid 500); 30 Mar 2012 09:23:00 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 24670 invoked by uid 500); 30 Mar 2012 09:22:59 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 24567 invoked by uid 99); 30 Mar 2012 09:22:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 09:22:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 09:22:57 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 2D41734E062 for ; Fri, 30 Mar 2012 09:22:36 +0000 (UTC) Date: Fri, 30 Mar 2012 09:22:36 +0000 (UTC) From: "Dawid Weiss (Commented) (JIRA)" To: dev@lucene.apache.org Message-ID: <1506302174.37138.1333099356186.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1342261124.31993.1333015468206.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LUCENE-3935) Optimize Kuromoji inner loop - rewrite ConnectionCosts.get() method 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/LUCENE-3935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242183#comment-13242183 ] Dawid Weiss commented on LUCENE-3935: ------------------------------------- bq. I did this hastily last night and results suggested that there wasn't a lot to be gained on Mac OS X I agree it may not be noticeable because there are so many factors kicking in here (smaller structure - better cpu cache utilization vs. larger structure - potentially faster access to each value but potential cache misses). Makes sense to keep short[] in place, ignore my comment. > Optimize Kuromoji inner loop - rewrite ConnectionCosts.get() method > ------------------------------------------------------------------- > > Key: LUCENE-3935 > URL: https://issues.apache.org/jira/browse/LUCENE-3935 > Project: Lucene - Java > Issue Type: Improvement > Components: modules/analysis > Affects Versions: 3.6, 4.0 > Reporter: Christian Moen > Assignee: Christian Moen > Attachments: LUCENE-3935.patch > > > I've been profiling Kuromoji, and not very surprisingly, method {{ConnectionCosts.get(int forwardId, int backwardId)}} that looks up costs in the Viterbi is called many many times and contributes to more processing time than I had expected. > This method is currently backed by a {{short[][]}}. This data stored here structure is a two dimensional array with both dimensions being fixed with 1316 elements in each dimension. (The data is {{matrix.def}} in MeCab-IPADIC.) > We can rewrite this to use a single one-dimensional array instead, and we will at least save one bounds check, a pointer reference, and we should also get much better cache utilization since this structure is likely to be in very local CPU cache. > I think this will be a nice optimization. Working on it... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org