ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin" ...@linlyu.com>
Subject Can I get a better performance on BinaryMarshaller?
Date Fri, 24 Jun 2016 08:53:57 GMT
Hi all,


I would like to migrate a system from Oracle Coherence to Apache Ignite, and we are doing
the performance evaluations.
BinaryMarshaller is an amazing feature, but compared with Coherence's POF Serialization, it
was not defeated.


Could you tell me is there are something wrong with my code or ignite settings, or anything
others to help to improve the performance on serialization.


Thanks very much.


Lin.




---------------------------------




Here is the data to be serialized, the size is 1840 bytes.





The size of Coherence as follow,



here is the result of Ignite BinaryMarshaller, 280 bytes vs 148 bytes.





The code for Ignite benchmark is as follow,


public static void withIgniteInstance(ArrayList<ArrayList<Object>> objectArrayLists)
throws IllegalAccessException {
    IgniteConfiguration icfg = new IgniteConfiguration();
    System.out.println(icfg.getIgniteHome());
    System.out.println(icfg.getWorkDirectory());

    BinaryConfiguration bCfg = new BinaryConfiguration();
    bCfg.setCompactFooter(true); 

    icfg.setMarshaller(new BinaryMarshaller());
    icfg.setBinaryConfiguration(bCfg);
    try (Ignite ignite = Ignition.start(icfg)) {
        BinaryMarshaller marshaller = (BinaryMarshaller) icfg.getMarshaller();

        for (ArrayList<Object> lst: objectArrayLists){
            int n = lst.size();
            long bytes = DataHelper.CalculateSize(lst);
            Summary input_summary = new Summary(bytes, n);
            ArrayList<Long> compressed_size = new ArrayList<>(n);

            TimeRecord tr = new TimeRecord();
            tr.reset();
            for (int i = 0; i < n; i++) {
                Samsara(marshaller, lst.get(i), compressed_size, true);
            }
            long time_cost = tr.end();
            Summary summary_compressed = Statics.summary(compressed_size);

            System.out.println("Avg Input size: " + input_summary.avg()
                    + " bytes, converting speed " + Format.speed(bytes, time_cost)
                    + ", avg compressed size = " + summary_compressed.avg()
                    + " bytes."
            );
        }
    }
}
Mime
View raw message