Share

DrJava

Tracker: Bugs

5 DrJava really slow - ID: 1763211
Last Update: Comment added ( sf-robot )

What is DrJava doing that makes it run so slowly? I wrote this program
that processes longitudes and latitudes data to draw out a map of the US.
When i run it in DrJava, it takes about 8 minutes to process a 1 MB file
and draw it all out. When i run Java from the command prompt, it takes 20
seconds.

It seems that i can't upload the data file because it's too large, so
here's a link:

http://www.cs.princeton.edu/introcs/36purple/USA.txt

For further contact, my e-mail is bensonl at cs.washington.edu


Nobody/Anonymous ( nobody ) - 2007-07-29 18:39

5

Closed

Invalid

Nobody/Anonymous

Performance

None

Public


Comments ( 7 )




Date: 2007-08-17 02:20
Sender: sf-robotSourceForge.net Site Admin


This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2007-08-02 21:51
Sender: mgrickenSourceForge.net SubscriberProject AdminAccepting Donations


I can't claim credit for the implementation, just for part of the
maintenance.


Date: 2007-08-02 21:47
Sender: c45207


I stand corrected. It's amazing what one can learn for the implementor of
a subsystem.


Date: 2007-08-02 21:10
Sender: mgrickenSourceForge.net SubscriberProject AdminAccepting Donations


When DrJava is not in debug mode, the debugger is not active and there is
no slowdown that can be attributed to DrJava's debugging features.
Execution within DrJava is slower because 1) the user program runs in a
separate Java virtual machine (JVM) and needs to communicate with DrJava's
JVM to do console I/O, and 2) the cost of doing console I/O in a graphical
environment such as DrJava is higher than in a text environment found in a
pure console.

To illustrate why 1) may be particularly costly, it may be worthwhile to
explain how the communication may be implemented. Depending on the
operating system, it may be as cheap as copying blocks of memory within
your RAM, or as expensive as sending the information through a networking
card using your IP address.

We are working hard to make DrJava as fast and easy to use as possible.
But all benefits come at a cost, and DrJava is no exception. I hope being
aware of these costs help. I mainly wanted to respond to the incorrect
statement that the debugger was causing the slowdown, though.


Date: 2007-08-02 20:17
Sender: c45207


Set to pending. This ticket will close in two weeks. If you think that
this issue has not been resolved, log in and post a comment here.


Date: 2007-08-02 20:15
Sender: c45207


DrJava has to add hooks into your program so that the debugger can
function. Although you may not be actively debugging, the debugger is still
active in order to allow you to debug unexpected exceptions.


Date: 2007-07-30 21:32
Sender: nobody

Logged In: NO

The problem seems to be the overzealous creation of Scanner objects in my
code. When i streamlined it, it ran a lot faster in DrJava. But even with
all the Scanners, it ran fast outside DrJava, so what is DrJava doing
differently?


Log in to comment.




Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
status_id Pending 2007-08-17 02:20 sf-robot
close_date 2007-08-02 20:15 2007-08-17 02:20 sf-robot
status_id Open 2007-08-02 20:15 c45207
resolution_id None 2007-08-02 20:15 c45207
close_date - 2007-08-02 20:15 c45207