[antlr-interest] multi-core usage

Andy Tripp antlr at jazillian.com
Thu Jun 12 14:50:14 PDT 2008


I have a mechanism where I spawn multiple threads to parse multiple files.
It speeds things up quite a bit, mostly because doing it single-threaded is
I/O bound. With the multiple threads, file reading and parsing can happen
in parallel.

As for multiple cores, I don't know how much multithreading will help.
>From what I've read, it's not easy to get Java to utilize multiple CPUs.
I would think you'd have to have incredibly huge input for ANTLR to use
a lot of CPU to parse it. Anyway, it's pretty easy to try out multithreading
in Java, so just try it and see what happens.



Edwards, Waverly wrote:
> 
> I have curiosity question.  Can ANTLR take advantage of multi-core 
> processors.
> The only place where I can think it would be possible would be in the 
> lexer where
> you might be able to apply one file per core to be tokenized.  Has 
> anyone tried?
> Again, just curious.
> 
> 
> W.
> 



More information about the antlr-interest mailing list