my rage from v8 is spilling over
Go to file
Juan Silveira 79f19eb9f1 Keep pointers to extension values.
The current implementation of getExtension deserialises the field from bytes
and returns a new object every time. This means that changes to those objects
are reflected when the messages is serialised unless setExtension is called. It
also means that every call to getExtension and setExtension is expensive.

This change introduces a FieldData class that contains everything that's known
about the field at the time. This can be all the tag/byte[] pairs associated
with a given field or an Extension and a value object. This is so that two
messages with a repeated extension can be compared even if the extension
has been deserialised in one of them but not the other.

This change also adds FieldArray class based on SparseArray from the Android
compatibility library. This is used in ExtendableMessageNano to make lookup
of FieldDatas by their field number faster.

Implications:
* calling getExtension multiple times deserialises the field only once and
  returns the same object.
* calling setExtension doesn't cause the object to be serialised immediately,
  that only happens when the container message is serialised.
* getExtension is no longer a read-only thread-safe operation. README.txt has
  been updated to relfect that.
* comparison using equals and hashCode continues to work.

Bug: 10863158

Change-Id: I81c7cb0c73cc0611a1f7c1eabf5eed259738e8bc
2014-07-14 16:54:28 +01:00
java Keep pointers to extension values. 2014-07-14 16:54:28 +01:00
src/google/protobuf Support generation of Parcelable nano messages. 2014-04-25 14:34:55 -07:00
Android.mk You CANNOT change the global WITH_DEXPREOPT 2014-05-01 20:45:22 -07:00