gridgain / gridgain-old

268 stars 85 forks source link

Avoid Java Serialisation and Reflection Internally #60

Closed sirinath closed 10 years ago

sirinath commented 10 years ago

Java Serialisation / reflection is slow so best use and alternative serialisation / reflection scheme internally.

Some alternatives: https://github.com/romix/quickser https://github.com/EsotericSoftware/kryo https://github.com/EsotericSoftware/reflectasm https://github.com/RuedigerMoeller/fast-serialization/wiki/Benchmark

sirinath commented 10 years ago

Having to have Serialisable Java 8 closures is a bit scary.

dsetrakyan commented 10 years ago

GridGain already has one of the fastest serialization protocols: http://gridgain.blogspot.com/2012/12/java-serialization-good-fast-and-faster.html

sirinath commented 10 years ago

Thats great but then why does your Java 8 closure has (Runnable & Serializable)() -> ...

dsetrakyan commented 10 years ago

Because lambdas must know that they are Serializable at compile time, not at runtime.

sirinath commented 10 years ago

Does lambdas use Java Serialisation within GG or the GG Serialisation scheme?

dsetrakyan commented 10 years ago

GG Serialization scheme, but for that to be used, lambdas must be compiled as Serializable, hence the (Runnable & Serializable) cast.

sirinath commented 10 years ago

OK