[ 
https://issues.apache.org/jira/browse/FLINK-3599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15473702#comment-15473702
 ] 

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_r77993831
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java 
---
    @@ -419,4 +481,61 @@ public String toString() {
                        return "NamedFlatFieldDescriptor [name="+fieldName+" 
position="+getPosition()+" typeInfo="+getType()+"]";
                }
        }
    +
    +   public static String accessStringForField(Field f) {
    +           String fieldName = f.getName();
    +           if (Modifier.isPublic(f.getModifiers())) {
    +                   return fieldName;
    +           }
    +           String getterName = "get" + 
Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
    +           Class parentClazz = f.getDeclaringClass();
    +           try {
    +                   parentClazz.getMethod(getterName, new Class[0]);
    +           } catch (NoSuchMethodException e) {
    +                   // No getter, it might be a scala class.
    +                   return fieldName + "()";
    +           }
    +           return getterName + "()";
    +   }
    +
    +   public static String modifyStringForField(Field f, String arg) {
    +           String fieldName = f.getName();
    +           if (Modifier.isPublic(f.getModifiers())) {
    +                   if (f.getType().isPrimitive()) {
    +                           return f.getName() + " = (" +
    +                                   
primitiveBoxedClasses.get(f.getType().getCanonicalName()).getCanonicalName() + 
")" + arg;
    --- End diff --
    
    Why do we need to cast to the boxed types if the field is non-boxed?


> 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)

Reply via email to