Results 1 to 3 of 3
- 03-09-2011, 04:30 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 54
- Rep Power
- 0
How to tune java performance on low end machines?
Hi All
I'm looking for hints as to how I can speed up a java program I'm writing.
I'm doing a little personal project to put on my NAS for which I was hoping to use java. The box is a 500MHz ARM based box running Debian and using openjdk-6-jre-headless for the JVM.
I'm having difficulties with performance which seem to be atributed to the fact that I'm using Java (perhapse it's the specific JVM but the SUN JVM doesnt appear to be available for ARM).
The stub that I've built so far compares a table of known files (stored in a PostgreSQL database) with actual files on the box comparing timestamps and filesizes as well as checking for new and removed files. It then batch updates the database as apropriate. For ~6000 files this takes ~2 minutes.
The same task done in C takes ~5 seconds.
I'm aware that Java can often be slower but this is serveral orders of magnitude slower.
The algorythm is simple enough:
- Select everything from the database which should be found in the directory we're scanning. (Using JDBC).
- Add the result set to a Map (Hash or Tree makes little difference)
- Recurse the directory tree removing from the map
- If a file is not found in the map then insert a new row
- If a file is found but with different stats then update the row
- Delete the row for anything left in the map at the end.
----Signature ----
Please use [CODE] tags and indent correctly. It really helps when reading your code.
- 03-09-2011, 05:13 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 03-10-2011, 09:11 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
JMF needed on target machines
By fatblacktone in forum New To JavaReplies: 1Last Post: 04-06-2010, 07:57 AM -
[SOLVED] Client/Server between two machines
By nwboy74 in forum NetworkingReplies: 1Last Post: 11-14-2008, 11:49 PM -
JDK versions on web server and client machines
By sunjavaboy in forum New To JavaReplies: 1Last Post: 03-21-2008, 04:59 AM -
How to determine all the IP addresses of machines on local LAN??
By JavaEmpires in forum NetworkingReplies: 3Last Post: 01-19-2008, 06:05 AM -
Cluster using 2 machines
By Albert in forum Advanced JavaReplies: 2Last Post: 07-04-2007, 06:31 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks