Oh, of course. Sorry for not reading :) Yeah, for cloning, it seems to be efficient... Can't really think of anything more efficient other than initializing the Stream with a better default 32 bytes (maybe?) or something like
http://jetty.mortbay.org/javadoc/org/mortbay/util/ByteBufferOutputStream.html Eelco On 1/20/06, Johan Compagner <[EMAIL PROTECTED]> wrote: > yes that i get... That is a better impl for Object.sizeOf() > if was talking about another commente about Object.clone() > Because there we really need to have the data. > > johan > > > > On 1/20/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: > > > > He basically just counts instead of also temporarily storing it as we > > do/ did. Makes sense. > > > > Eelco > > > > > > On 1/20/06, Johan Compagner <[EMAIL PROTECTED]> wrote: > > > and i am curious what a better implementation will be for > Objects.clone() > > > ByteArray is pretty basic i believe. It just stores the bytes it get.. > in an > > > internal byte[] > > > > > > If he is saying that a better implementation of ObjectOutputStream that > > > could be possible, > > > (own thing for serializing) > > > > > > johan > > > > > > > > > > > > On 1/18/06, Jonathan Locke <[EMAIL PROTECTED]> wrote: > > > > > > > > must is a strong word and this is more rfe than bug since sizeof is > only > > > > used in debugging with the inspector, but this does seem good. > > > > > > > > SourceForge.net wrote: > > > > > Bugs item #1409210, was opened at 2006-01-18 19:04 > > > > > Message generated for change (Tracker Item Submitted) made by Item > > > Submitter > > > > > You can respond by visiting: > > > > > > > > > https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1409210&group_id=119783 > > > > > > > > > > Please note that this message will contain a full copy of the > comment > > > thread, > > > > > including the initial issue submission, for this request, > > > > > not just the latest update. > > > > > Category: core > > > > > Group: 1.2 > > > > > Status: Open > > > > > Resolution: None > > > > > Priority: 5 > > > > > Submitted By: ejboy (ejboy) > > > > > Assigned to: Nobody/Anonymous (nobody) > > > > > Summary: wicket.util.lang.Objects.sizeof() should be more effective > > > > > > > > > > Initial Comment: > > > > > To avoid unnecessary memory usage ByteArrayOutputStream > > > > > must be replaced with a subclass of OutputStream like this: > > > > > class CountingOutputStream extends OutputStream { > > > > > private long size; > > > > > > > > > > public void write(int b) throws IOException { > > > > > size++; > > > > > } > > > > > > > > > > public void write(byte b[], int off, int len) > > > > > throws IOException { > > > > > size += len; > > > > > } > > > > > > > > > > public long getSize() { > > > > > return size; > > > > > } > > > > > > > > > > > > > > > } > > > > > > > > > > Similar optimization may be applied to Objects.clone() > > > > > method, by replacing ByteArrayInputStream and > > > > > ByteArrayOutputStream with a more effective > > > > > implementations. > > > > > > > > > > > > > > ---------------------------------------------------------------------- > > > > > > > > > > You can respond by visiting: > > > > > > > > > https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1409210&group_id=119783 > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through > log > > > files > > > > > for problems? Stop! Download the new AJAX search engine that makes > > > > > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > > > > > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > > > > > _______________________________________________ > > > > > Wicket-develop mailing list > > > > > Wicket-develop@lists.sourceforge.net > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > > > files > > > > for problems? Stop! Download the new AJAX search engine that makes > > > > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > > > > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > > > > _______________________________________________ > > > > Wicket-develop mailing list > > > > Wicket-develop@lists.sourceforge.net > > > > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > > > http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642 > > _______________________________________________ > > Wicket-develop mailing list > > Wicket-develop@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop > > > > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Wicket-develop mailing list Wicket-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-develop