----- Original Message -----
From: "Ara Abrahamian" <[EMAIL PROTECTED]>
Date: Monday, February 25, 2002 6:09 pm
Subject: RE: grammar

> > I guess that's enough optimising for now. The rest of the job is:
> > 
> > 1) Write a proper test suite. Throw away the test classes that are
> there
> > and
> > add some custom written ones and try to break xjavadoc - and fix
> remaining
> > bugs.
> > 2) Put xjavadoc into xdoclet
> > 3) Pick up Reverse XDoclet and XTags. (Konstantin is already working
> on
> > the
> > gui I think)
> 
> Btw, I found an even easier way of doing this optimization:
> Create an HaltException class which derives from ParseException and
> throw it after reading ClassDeclaration but before the { sign. 
> Catch the
> exception, if instanceof HaltException then it's in halt, keep the
> source file content in ProxyClass preferably in a WeakReference. Now
> when user uses some of the inner methods like methods()/fields() 
> run the
> parser again, we can somehow pass the old SourceClass reference to
> parser instead of creating one.
> 
> What's the gain? No threads. Are we going to create 600 threads? I 
> thinkit's problematic on linux for example and certainly doesn't 
> scale for
> higher number of classes.
> 
> What do you think? Should I spend time on it?
> 

Maybe. In the current scenario there is only one of the 60000 threads 
running at a time, because of the locking. We could use 60000 Runnables 
instead and just have 2 threads: the main and the parser thread, which 
jumps back and forth between the Runnables. This kills your scalability 
argument I think.

-But the Exception approach sounds tempting too. We could add a boolean 
flag to the ClassBody method, and use the flag to decide whether or not 
to throw an exception. The second time, we set the flag to false.

I guess these are the two options. Personally I'm scared of threads, 
and I think it's no point in using threads unless we let several of 
them to run simultaneously. That could be an even greater optimiser, 
but I think 5x is enough for now. -But 5x is only true if we never go 
into the methods. When we start doing that, performance will go down, 
and there is the unicode hog too.

I think you should go for the HaltException now, but we *might* have to 
go for a Runnable approach later. Go ahead and code it. I'll look at 
the tests.

Aslak

> Ara.
> 
> 
> 
> _________________________________________________________
> 
> Do You Yahoo!?
> 
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> 
> 


_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to