[ https://issues.apache.org/jira/browse/FLINK-3599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15473565#comment-15473565 ]
ASF GitHub Bot commented on FLINK-3599: --------------------------------------- Github user ggevay commented on a diff in the pull request: https://github.com/apache/flink/pull/2211#discussion_r77986502 --- Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java --- @@ -70,10 +77,41 @@ private static final Pattern PATTERN_NESTED_FIELDS = Pattern.compile(REGEX_NESTED_FIELDS); private static final Pattern PATTERN_NESTED_FIELDS_WILDCARD = Pattern.compile(REGEX_NESTED_FIELDS_WILDCARD); + private static final Map<Class<?>, Class<? extends TypeSerializer>> customSerializers = new HashMap<>(); + private static final Map<Tuple2<ArrayList<Integer>, Class>, Class<? extends TypeComparator>> customComparators = + new HashMap<>(); + private final PojoField[] fields; private final int totalFields; + /** + * Register a custom serializer for a type. The precedence of the serializers + * is the following (highest to lowest): Kryo, Avro, Custom, Generated, Flink. + * The chosen serializer will be the first one from the list that is turned on. --- End diff -- I think the wording "turned on" is a bit confusing, because it means different things for the different elements of this list. - I guess for Kryo, Avro, and Generater, you mean `enableForceKryo`, `enableForceAvro`, `enableCodeGeneration` was called? - For "Custom", you mean that this method was called for the particular type. - For "Flink", you are talking about `PojoSerializer`? This is kind of always turned on. However, it is not always applicable (if the type is not a POJO), in which case we fall back to Kryo, even if it is not "turned on" in the above sense, which is also confusing. Another problem is that I'm not sure what happens with Tuples (and basic types and other special types) if `enableForceKryo` was called. I guess they don't participate in this mess and always get serialized by their special built-in serializers? > GSoC: Code Generation in Serializers > ------------------------------------ > > Key: FLINK-3599 > URL: https://issues.apache.org/jira/browse/FLINK-3599 > Project: Flink > Issue Type: Improvement > Components: Type Serialization System > Reporter: Márton Balassi > Assignee: Gabor Horvath > Labels: gsoc2016, mentor > > The current implementation of the serializers can be a > performance bottleneck in some scenarios. These performance problems were > also reported on the mailing list recently [1]. > E.g. the PojoSerializer uses reflection for accessing the fields, which is > slow [2]. > For the complete proposal see [3]. > [1] > http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Tuple-performance-and-the-curious-JIT-compiler-td10666.html > [2] > https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L369 > [3] > https://docs.google.com/document/d/1VC8lCeErx9kI5lCMPiUn625PO0rxR-iKlVqtt3hkVnk -- This message was sent by Atlassian JIRA (v6.3.4#6332)