MappingProcessor.map with MapID (null)

Help
Anonymous
2010-11-10
2013-05-02
  • Anonymous - 2010-11-10

    Im using version 5.2.2 with xml for my mappings and running into a performance problem when I'm mapping back to the original object structure..
    Yet, with in MappingProcessor.map
    it is calling the method sig below with no mapping ID….
    map(classMap, srcObj, result, false, null);

    So in essence It's not using Context Based Mapping….
    Help.

     
  • dmitry (lv)

    dmitry (lv) - 2010-11-10

    I am afraid the explanation you provided is not sufficient to help you.

    You could start with some of the following:
    * what is the performance problem - number of mapped objects and time it takes
    * can you reproduce that behavior on isolated test case and provide us with that
    * can you find which part of the mappings is slow by excluding fields one by one
    * can you run profiling tool to determine which methods execution take most of the time

    In Dozer it does not change anything if you map forward or backwards. So unfortunately your post gives no clues where to look.

    Dmitry

     
  • Anonymous - 2010-11-11

    Performance mapping back .. Mapping from their object the it performs well.
    It's the mapping back that is taking more time.
    I was going to use Context Based Mapping to only map the fields on the screen to their objects that are effected by the end user, instead of having to map every attribute.

    Reproducing the problem outside of the application (right now we do not have time, I know there is always time and it would help).
    I can re-produce the problem in JUnit tests against the same functionality. It takes about 0.45ms to map from their objects to mine, yet about 9.00 to map back to their objects/Interfaces.

    Profiling has not indicated anything that I can tell as of yet.

    I've wrapped GlobalStatistics in a class that also uses org.springframework.util.StopWatch I start the stop watch when I enable statistics and stop it when statistics is disabled and then print the info to logs..

    For instance this is the performance and statistics on a get (from their objects to mine)

    WebContainer : 5 INFO  statistics.NCISDozerStatistics - MAPPING_SUCCESS_COUNT  =  5
    WebContainer : 5 INFO  statistics.NCISDozerStatistics - FIELD_MAPPING_SUCCESS_COUNT  =  1259
    WebContainer : 5 INFO  statistics.NCISDozerStatistics - MAPPING_TIME  =  4594
    WebContainer : 5 INFO  statistics.NCISDozerStatistics - SUPER_TYPE_CHECK  =  21
    WebContainer : 5 INFO  statistics.NCISDozerStatistics - SUPER_TYPE_CHECK  =  91
    WebContainer : 5 INFO  stats.StatisticsManagerImpl - [org.dozer.stats.Statistic@72e672e6[
      type=MAPPING_SUCCESS_COUNT
      entriesMap={MAPPING_SUCCESS_COUNT=org.dozer.stats.StatisticEntry@74a474a4[
      key=MAPPING_SUCCESS_COUNT
      value=5
    ]}
    ], org.dozer.stats.Statistic@1c461c46[
      type=FIELD_MAPPING_SUCCESS_COUNT
      entriesMap={FIELD_MAPPING_SUCCESS_COUNT=org.dozer.stats.StatisticEntry@263c263c[
      key=FIELD_MAPPING_SUCCESS_COUNT
      value=1259
    ]}
    ], org.dozer.stats.Statistic@74b874b8[
      type=MAPPING_TIME
      entriesMap={MAPPING_TIME=org.dozer.stats.StatisticEntry@76667666[
      key=MAPPING_TIME
      value=4594
    ]}
    ], org.dozer.stats.Statistic@42744274[
      type=CACHE_MISS_COUNT
      entriesMap={SUPER_TYPE_CHECK=org.dozer.stats.StatisticEntry@6fc46fc4[
      key=SUPER_TYPE_CHECK
      value=21
    ]}
    ], org.dozer.stats.Statistic@2ee42ee4[
      type=CACHE_HIT_COUNT
      entriesMap={SUPER_TYPE_CHECK=org.dozer.stats.StatisticEntry@30983098[
      key=SUPER_TYPE_CHECK
      value=91
    ]}
    ]]
    WebContainer : 5 INFO  statistics.NCISDozerStatistics - getData OneAmerica   Dozer Mapping: 0.25

    Now the Save:

    I capture two different process stats and the over all time it takes to just map the data back to their objects:
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - MAPPING_TIME  =  10360
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - FIELD_MAPPING_SUCCESS_COUNT  =  1457
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - MAPPING_SUCCESS_COUNT  =  14
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - SUPER_TYPE_CHECK  =  91
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - SUPER_TYPE_CHECK  =  30
    WebContainer : 6 INFO  stats.StatisticsManagerImpl - [org.dozer.stats.Statistic@c120c12[
      type=MAPPING_TIME
      entriesMap={MAPPING_TIME=org.dozer.stats.StatisticEntry@dc00dc0[
      key=MAPPING_TIME
      value=10360
    ]}
    ], org.dozer.stats.Statistic@73c273c2[
      type=FIELD_MAPPING_SUCCESS_COUNT
      entriesMap={FIELD_MAPPING_SUCCESS_COUNT=org.dozer.stats.StatisticEntry@75707570[
      key=FIELD_MAPPING_SUCCESS_COUNT
      value=1457
    ]}
    ], org.dozer.stats.Statistic@a500a50[
      type=MAPPING_SUCCESS_COUNT
      entriesMap={MAPPING_SUCCESS_COUNT=org.dozer.stats.StatisticEntry@bfe0bfe[
      key=MAPPING_SUCCESS_COUNT
      value=14
    ]}
    ], org.dozer.stats.Statistic@25522552[
      type=CACHE_HIT_COUNT
      entriesMap={SUPER_TYPE_CHECK=org.dozer.stats.StatisticEntry@27062706[
      key=SUPER_TYPE_CHECK
      value=91
    ]}
    ], org.dozer.stats.Statistic@67286728[
      type=CACHE_MISS_COUNT
      entriesMap={SUPER_TYPE_CHECK=org.dozer.stats.StatisticEntry@14a014a[
      key=SUPER_TYPE_CHECK
      value=30
    ]}
    ]]
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - mapNCASProduct2BusinessTierProduct    Dozer Mapping: 2.703
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - MAPPING_TIME  =  10360
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - FIELD_MAPPING_SUCCESS_COUNT  =  1457
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - MAPPING_SUCCESS_COUNT  =  14
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - SUPER_TYPE_CHECK  =  91
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - SUPER_TYPE_CHECK  =  30
    WebContainer : 6 INFO  stats.StatisticsManagerImpl - [org.dozer.stats.Statistic@c120c12[
      type=MAPPING_TIME
      entriesMap={MAPPING_TIME=org.dozer.stats.StatisticEntry@dc00dc0[
      key=MAPPING_TIME
      value=10360
    ]}
    ], org.dozer.stats.Statistic@73c273c2[
      type=FIELD_MAPPING_SUCCESS_COUNT
      entriesMap={FIELD_MAPPING_SUCCESS_COUNT=org.dozer.stats.StatisticEntry@75707570[
      key=FIELD_MAPPING_SUCCESS_COUNT
      value=1457
    ]}
    ], org.dozer.stats.Statistic@a500a50[
      type=MAPPING_SUCCESS_COUNT
      entriesMap={MAPPING_SUCCESS_COUNT=org.dozer.stats.StatisticEntry@bfe0bfe[
      key=MAPPING_SUCCESS_COUNT
      value=14
    ]}
    ], org.dozer.stats.Statistic@25522552[
      type=CACHE_HIT_COUNT
      entriesMap={SUPER_TYPE_CHECK=org.dozer.stats.StatisticEntry@27062706[
      key=SUPER_TYPE_CHECK
      value=91
    ]}
    ], org.dozer.stats.Statistic@67286728[
      type=CACHE_MISS_COUNT
      entriesMap={SUPER_TYPE_CHECK=org.dozer.stats.StatisticEntry@14a014a[
      key=SUPER_TYPE_CHECK
      value=30
    ]}
    ]]
    WebContainer : 6 INFO  statistics.NCISDozerStatistics - saveScreen com.oneamerica.ncas.oneamerica.OneAmerica   Dozer Mapping: 9.297

     
  • Anonymous - 2010-11-11

    I'm trying to identify the bottle neck.
    We are mapping over 3,200 fields in this app. And there is inheritance.

    I've tried to use  Context Based Mapping. yet Dozer seems to ignore the MapId with in MappingProcessor.map it is calling the method sig below with no mapping ID…. map(classMap, srcObj, result, false, null);

    MappingProcessor Line 179 of Dozer Version 5.2.2

    Any insight you or anyone else may have would be greatly appreciated.

     
  • dmitry (lv)

    dmitry (lv) - 2010-11-11

    Quickly looked at the code and there ideed may be problem with map-id with inheritance. I could take a closer look on weekend.

    If I understand correctly you are trying to decrease the number of fields mappings with help of map-id.
    If this does not help now you could use multiple DozerBeanMapper instances, configured for different use cases. This would be the most optimal solution if several mapping scenarious exist. The tricky part is to split and register mappings correctly.

    Dmitry

     
  • Anonymous - 2010-11-11

    Thanks, I've got the DozerMapper instance registered with spring and your right I could set it up for different direction of communications..
    Yes, I was wanting to eliminate some of the mapping so that the general screens with limited amounts of data can only map what is needed and in the more specific screens that require more data would map fully.

     
  • Anonymous - 2010-11-16

    Improved times by about a sec a piece, yet still not good enough.

    Buzbin, any updates.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks