Closed sirinath closed 10 years ago
Having to have Serialisable Java 8 closures is a bit scary.
GridGain already has one of the fastest serialization protocols: http://gridgain.blogspot.com/2012/12/java-serialization-good-fast-and-faster.html
Thats great but then why does your Java 8 closure has (Runnable & Serializable)() -> ...
Because lambdas must know that they are Serializable at compile time, not at runtime.
Does lambdas use Java Serialisation within GG or the GG Serialisation scheme?
GG Serialization scheme, but for that to be used, lambdas must be compiled as Serializable, hence the (Runnable & Serializable) cast.
OK
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