mrszj / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Abstract away serialization standins #229

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I like to almost 100% separate serialization logic from my classes and not
let it impact their design. We should avoid eagerly creating new objects
just to make serialization happy and instead defer the creation of such
objects until serialization occurs. This has real performance implications
on platforms like Android.

Original issue reported on code.google.com by crazybob...@gmail.com on 7 Aug 2008 at 12:48

GoogleCodeExporter commented 9 years ago
This is not an optimization we should do naively.

Our serialization standins (ie. ParameterizedTypeImpl, etc.) may do fewer 
object allocations than the standard 
Type implementations in the JDK. Since the Type interface is array-centric, 
there's a lot of array cloning in 
methods like getActualTypeArguments(). By using our own implementations, we can 
avoid array clones by 
accessing the data directly (for example, in our isFullySpecified() method).

Original comment by limpbizkit on 31 Dec 2008 at 12:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by cgruber@google.com on 18 Nov 2013 at 8:12