3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 15:22:16 +00:00
Commit Graph

9 Commits

Author SHA1 Message Date
Mike Hearn
da10e0ca69 Update TODO file. 2011-12-29 20:27:45 +00:00
Mike Hearn
9549d345a7 Delete some dead code. 2011-11-25 09:58:21 +00:00
Miron Cuperman (devrandom)
3a463e4799 Cleanup of lazy block parsing, patch from shadders 2011-11-12 23:20:04 +00:00
Mike Hearn
ee083d6fac Patch 9 from Steves lazy parsing patchset.
Add UnsafeByteArrayOutputStream.  ByteArrayOutputStreams are used extensively and result in a lot of short lived byte arrays.

This patch contains two optimizations

1/ attempt to provide the final length to ByteArrayOutputStream constructor to avoid constantly resizing the backing array.  Default size is 32 which means larger messages may require several array reallocations and almost all will require at least one.

2/ provides the UnsafeByteArrayOutputStream class which eliminates method synchronization.  The toByteArray() will return the backing array rather than a copy if the correct length was provided in the constructor.

In the worst case scenario this cuts array allocations from 3 to 2.
In the most common worst case from 3 to 1.
In most best cases where final array size is greater than 128 bytes from > 4 to 1.
2011-10-14 12:37:27 +00:00
Mike Hearn
06ad3e5bb1 Patch 6 from Steves lazy parsing patchset:
Deduping related optimizations. This code will be removed later.
2011-10-14 12:27:16 +00:00
Mike Hearn
afef6bc029 Second part of Steves lazy parsing patchset:
1) Added getters and setters to many objects that lacked them.
2) Introduce a parseLite method that is called even in "lazy parse" mode. This calculates the length of the message so children can be skipped when parsing a container object.
3) Full serialization for AddressMessage
4) Added a (huge, standalone) SpeedTest.
5) Add unit tests for the matrix of lazy parsing modes.

A bunch of review comments are added to the TODO list for completion after the patch series is checked in. This is to avoid large numbers of merge conflicts as later parts of the patch-series are committed.
2011-10-11 17:24:50 +00:00
Mike Hearn
34fea86708 First part of Steves changes in preparation for a high performance multiplexing proxy:
1) Introduce partial support for caching the underlying byte arrays during message deserialization, so re-serialization can be skipped in the case where a message is not modified.
 
 2) Add c'tors that allow a message to be configured to lazily parse on-demand.
 
 Note that the getters/setters that make lazy parsing transparent are coming in future commits.
2011-10-11 13:08:54 +00:00
Mike Hearn
ca84bea462 Refresh the TODO file 2011-06-27 14:34:48 +00:00
Mike Hearn
fbb93e4c27 Initial checkin of BitCoinJ 2011-03-07 10:17:10 +00:00