streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Blackmon <st...@blackmon.org>
Subject Re: [jira] [Commented] (STREAMS-288) StreamsJacksonModule should not scan for DateTimeFormats by default
Date Tue, 17 Feb 2015 20:13:50 GMT
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;   }

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.


On Tue, Feb 17, 2015 at 2:07 PM, ASF GitHub Bot (JIRA) <jira@apache.org>
wrote:

>
>     [
> https://issues.apache.org/jira/browse/STREAMS-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14324789#comment-14324789
> ]
>
> ASF GitHub Bot commented on STREAMS-288:
> ----------------------------------------
>
> Github user smashew commented on the pull request:
>
>
> https://github.com/apache/incubator-streams/pull/187#issuecomment-74742070
>
>     If you scan, you should only scan the classpath ONCE! Collect the
> classes that you want to use and never, ever, EVER scan the class-path,
> ever again.
>
>
> > StreamsJacksonModule should not scan for DateTimeFormats by default
> > -------------------------------------------------------------------
> >
> >                 Key: STREAMS-288
> >                 URL: https://issues.apache.org/jira/browse/STREAMS-288
> >             Project: Streams
> >          Issue Type: Bug
> >            Reporter: Robert Douglas
> >
> > The StreamsJacksonModule's constructor is called all over the codebase
> and by default, it uses Reflections to scan the classpath for valid
> DateTimeFormats.
> > This is problematic because it will happen multiple times during a
> Stream's runtime, considerably slowing down the execution.
> > Instead, we should default to NOT scanning the classpath, but provide a
> constructor where we can pass in a flag dictating whether or not we want to
> scan.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message