Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>From <a href="https://github.com/EsotericSoftware/kryo" rel="nofollow">their page</a>:</p> <blockquote> <p>The 2.22 release fixes many reported issues and improves stability and performance. It also introduces a number of new features, most notably that it <strong>can use Unsafe to read and write object memory directly. This is the absolute fastest way to do serialization, especially for large primitive arrays</strong>.</p> </blockquote> <p>It uses direct bytecode-level access to the fields - <code>sun.misc.Unsafe</code> or <a href="http://asm.ow2.org/" rel="nofollow">ASM library</a>. Kryo was fast even before introducing unsafe usage. The general answer, I think, is that performance is their highest priority. Java's reflection is not that slow when used carefully - i.e. when the <code>java.lang.Field</code> and <code>java.lang.Method</code> are cached. I set up an experiment which sorted an array with two different comparators - one was using direct field access and the other was using cached fields. There was only 2x difference, which means unnoticeable in context with IO. </p> <p><strong><a href="https://github.com/EsotericSoftware/kryo#fieldserializer" rel="nofollow">FieldSerializer</a>:</strong></p> <blockquote> <p>By default, most classes will end up using <code>FieldSerializer</code>. It essentially does what hand written serialization would, but does it automatically. <code>FieldSerializer</code> does direct assignment to the object's fields. <strong>If the fields are public, protected, or default access (package private), bytecode generation is used for maximum speed (see ReflectASM). For private fields, setAccessible and cached reflection is used, which is still quite fast.</strong></p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload