streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steveblackmon <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh...
Date Tue, 17 Feb 2015 20:20:58 GMT
Github user steveblackmon commented on the pull request:

    https://github.com/apache/incubator-streams/pull/187#issuecomment-74744716
  
    So this is just a performance concern? I agree that creating a new Mapper inside of a
loop is obviously a bad idea.  That's why :
    
    public class StreamsJacksonMapper extends ObjectMapper {
    
        private static final StreamsJacksonMapper INSTANCE = new StreamsJacksonMapper();
    
        public static StreamsJacksonMapper getInstance(){    return INSTANCE;   }
    
    Get your mapper this way and only once and problem solved.
    
    I don't think the fact that bad implementations can get slow is a reason to make the default
behavior worse, to make a call that should only happen once per jvm a bit faster.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message