You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Darryl Green (JIRA)" <ji...@apache.org> on 2017/05/25 11:41:08 UTC

[jira] [Created] (AVRO-2037) Use std::any where available

Darryl Green created AVRO-2037:
----------------------------------

             Summary: Use std::any where available
                 Key: AVRO-2037
                 URL: https://issues.apache.org/jira/browse/AVRO-2037
             Project: Avro
          Issue Type: Improvement
          Components: c++
            Reporter: Darryl Green


The use of boost::any to hold union types causes a significant performance hit especially for small types - in particular the when using [null,primitive] for optional primitive type elements of a schema. Most (all?) implementations of std::any include a small value optimisation that avoids allocation overhead for scalars and other small types. Its a little unfortunate that the performance of a C++ binding of r a notionally high performance serialization format performs so poorly in this case (note - I had previously proposed using boost::variant which would address this problem but would fail to support recursive types or truly huge numbers of distinct types in a union). Obviously this requires C++ 17 but could fall back to boost::any for older compilers.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)