lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Carson" <ncar...@everdreamcorp.com>
Subject RE: [jira] Commented: (LUCENENET-8) Throwing an exception as a result of a normal situation is extremely bad in .net
Date Mon, 09 Oct 2006 20:02:16 GMT
Hi George

Can you tell us what bug this (potentially) causes? Because of the
almost 100x increase in indexing performance, we plan to keep this
change in our code base (possibly, exceptions are much more expensive in
.net than java?)

	Neil 


> -----Original Message-----
> From: Mark Brinicombe 
> Sent: Wednesday, October 04, 2006 11:20 AM
> To: Neil Carson; 'lucene-net-dev@incubator.apache.org'
> Subject: RE: [jira] Commented: (LUCENENET-8) Throwing an 
> exception as a result of a normal situation is extremely bad in .net
> 
> Hi,
>   The diff is attached.
> 
> It is similar to the patch already proposed.
> 
> All occurrances of FastCharStream return '\0' instead of 
> throwing an exception.
> All places that call the Read() method on the CharStream 
> interface have been changed to remove the try-catch blocks 
> for IOException and instead test the returned char value. The 
> code paths in the try-catch blocks were checked to make sure 
> that the only IOException were coming from the FastCharStream EOF.
> Similarly for calls to the BeginToken() method as well.
> 
> I can see the issue on the Java side as several of the files 
> that were patched are created via JavaCC 
> (StandardTokenizerTokenManager & QueryParserTokenManager
> 
> Cheers,
>             Mark
> 
> 
> 
> -----Original Message-----
> From: Neil Carson
> Sent: Wednesday, October 04, 2006 9:44 AM
> To: 'lucene-net-dev@incubator.apache.org'
> Cc: Mark Brinicombe
> Subject: RE: [jira] Commented: (LUCENENET-8) Throwing an 
> exception as a result of a normal situation is extremely bad in .net
> 
> Mark - can you send the diff/info?
> 
> 	Neil
>  
> 
> > -----Original Message-----
> > From: George Aroush [mailto:george@aroush.net]
> > Sent: Tuesday, October 03, 2006 7:59 PM
> > To: lucene-net-dev@incubator.apache.org
> > Cc: Mark Brinicombe
> > Subject: RE: [jira] Commented: (LUCENENET-8) Throwing an 
> exception as 
> > a result of a normal situation is extremely bad in .net
> > 
> > Hi Neil,
> > 
> > I believe you changed at more then this one place.  And I 
> believe you 
> > have a bug waiting to happen (unless if you did other changes to 
> > prevent the bug.)
> > 
> > Per my JIRA comment, I submitted this question to the Java Lucene 
> > mailing list.  The response that I got is not to make this 
> change as 
> > it will break Lucene -- yes, they are aware that it will 
> make Lucene 
> > run faster (the Java version too.)
> > 
> > You can read the two responses (so far) that I got here:
> > http://mail-archives.apache.org/mod_mbox/lucene-java-dev/20061
> 0.mbox/%3cc68e
> > 39170610031908s12e4894aqee69221d5eb5c9e9@mail.gmail.com%3e
> > 
> > What version of Lucne.Net are you using?  Can give me a 
> difference of 
> > your version vs. what's under SVN (of your version)?  This 
> should help 
> > identify what caused your modified version run faster.
> > 
> > Regards,
> > 
> > -- George Aroush
> > 
> > 
> > -----Original Message-----
> > From: Neil Carson [mailto:ncarson@everdreamcorp.com]
> > Sent: Tuesday, October 03, 2006 10:42 PM
> > To: lucene-net-dev@incubator.apache.org;
> > lucene-net-dev@incubator.apache.org
> > Cc: Mark Brinicombe
> > Subject: RE: [jira] Commented: (LUCENENET-8) Throwing an 
> exception as 
> > a result of a normal situation is extremely bad in .net
> > 
> > Hi George
> >  
> > You may want to really consider this one. We were running tests 
> > indexing a dozen or two fields, and making this change made 
> Lucene.NET 
> > almost 100x faster indexing. Yes, really that order of 
> magnitude from 
> > a simple change.
> >  
> > I'm not sure if that's the only place we changed... Mark?
> >  
> >     Neil
> > 
> > ________________________________
> > 
> > From: George Aroush (JIRA) [mailto:jira@apache.org]
> > Sent: Tue 10/3/2006 6:42 PM
> > To: lucene-net-dev@incubator.apache.org
> > Subject: [jira] Commented: (LUCENENET-8) Throwing an exception as a 
> > result of a normal situation is extremely bad in .net
> > 
> > 
> > 
> >     [
> > http://issues.apache.org/jira/browse/LUCENENET-8?page=comments
> #action_124397
> > 02 ]
> >            
> > George Aroush commented on LUCENENET-8:
> > ---------------------------------------
> > 
> > Hi,
> > 
> > I am all for making Lucene.Net faster.  At the same time, I want to 
> > preserve the compatibility of Lucene.Net with it's Java 
> version..  If 
> > this throw was introduced in the .Net version only, then I 
> would have 
> > made the change, but it's not
> > -- Java Lucene has the same code.
> > 
> > I will post this JIRA issue to the Java mailing list and 
> see what they 
> > have to say about it.  Who knows, they agree that it should be 
> > removed.
> > 
> > Regards,
> > 
> > -- George Aroush
> > 
> > > Throwing an exception as a result of a normal situation is
> > extremely
> > > bad in .net
> > > 
> > 
> ----------------------------------------------------------------------
> > > ----------
> > >
> > >                 Key: LUCENENET-8
> > >                 URL: 
> > http://issues.apache.org/jira/browse/LUCENENET-8
> > >             Project: Lucene.Net
> > >          Issue Type: Task
> > >         Environment: Windows XP, Visual Studio 2003
> > >            Reporter: Jo Inge Arnes
> > >         Attachments: test.patch
> > >
> > >
> > > At the end of the FastCharStream.Refill() method, it says:
> > > int charsRead = input.Read(buffer, newPosition, buffer.Length - 
> > > newPosition); if (charsRead <= 0)
> > >    throw new System.IO.IOException("read past eof"); else
> > >    bufferLength += charsRead;
> > > When I run Lucene in the debugger, this causes an exception to be 
> > > thrown
> > all the time.
> > > To me it looks like it is thrown as a result of a normal 
> situation, 
> > > not
> > because of some critical error.
> > > Is this correct?
> > > If this is the case, then the code is horrible. Throwing an
> > exception
> > > in
> > .NET is extremely slow, and should never be thrown as a result of a 
> > normal situation. I repeat: "extremely slow"
> > 
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the
> > administrators:
> > http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > For more information on JIRA, see: 
> > http://www.atlassian.com/software/jira
> > 
> >        
> > 
> > 
> > 
> > 
> 

Mime
View raw message