I've already tested the file scanner which takes a few seconds to scan the whole file. This is stalling, just blinking the cursor while nothing happens...
Ernest Friedman-Hill
author and iconoclast
Marshal
add some of System.out.println and to see where you stop.
Jesse Crockett
Ranch Hand
Joined: Feb 03, 2005
Posts: 129
posted
0
actually the code was fine. it just took a lot longer to run than my test code. the cursor was blinking on an empty screen for so long that i thought it wasnt running right. i made it print out each set of tokens while it's running. now it's been running fine for over a minute, but it's still in the B's. thanks :roll:
Ernest Friedman-Hill
author and iconoclast
Marshal
1) I bet you've heard at least once that using StringBuffer (or the JDK 1.5 StringBuilder) is better than using String and the "+" operator. This program is absolutely one of those times. If you made tokenList into a StringBuffer (or StringBuilder) and used separate "append()" calls instead of each "+" operation, you'd have a noticeable speedup.
2) Another probably large performance improvement could be gotten with buffered I/O. Replace the Scanner allocation with
3) Your signature is hella confusing -- I thought it was part of your question, originally, which really confused me, as I couldn't see where any of that output was supposed to come from. I'd change it if I were you!