Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't serialize object




On Jul 11, 2006, at 1:50 AM, Greg Guerin wrote:

Lou Cohen wrote:

My thought was that serialization seemed to be quite easy to implement, so
why not at least find out if it provided any performance improvement? I
thought it might be easier to write the serialization code than to devise a
series of tests to isolate the performance problem.

Profiling your code simply measures it.

Considering the slowdown the code seems to be having you could possibly track it down without getting into profiling. Although profiling might be a useful skill to acquire in dealing with this sort of situation.
But it could probably be found reasonably quickly just with currentTimeMillis() and println's by playing the hi-lo game.
Say you have


       long initTime = System.currentTimeMillis();
	long now = 0, elapsed = 0;

	and code like...
	
	System.out.println("Before method a");
        methoda();
	now = System.currentTimeMIllis();
	elapsed = now - initTime;
	initTime = now;
	System.out.println("methoda took " + elapsed + " ms");
	System.out.println("Before method b");
	methodb();
	now = System.currentTimeMIllis();
	elapsed = now - initTime;
	initTime = now;
	System.out.println("methodb took " + elapsed + " ms");

If you see that methodb is taking 30x as long as methoda then you further narrow it down to something less broad to determine where it is doing that.


Mike Hall mikehall at spacestar dot net http://www.spacestar.net/users/mikehall http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Can't serialize object (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.