Return-Path: X-Original-To: apmail-streams-dev-archive@minotaur.apache.org Delivered-To: apmail-streams-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C30B017C6B for ; Tue, 17 Feb 2015 20:21:33 +0000 (UTC) Received: (qmail 68765 invoked by uid 500); 17 Feb 2015 20:21:33 -0000 Delivered-To: apmail-streams-dev-archive@streams.apache.org Received: (qmail 68718 invoked by uid 500); 17 Feb 2015 20:21:33 -0000 Mailing-List: contact dev-help@streams.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@streams.incubator.apache.org Delivered-To: mailing list dev@streams.incubator.apache.org Received: (qmail 68707 invoked by uid 99); 17 Feb 2015 20:21:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 20:21:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 17 Feb 2015 20:21:31 +0000 Received: (qmail 67463 invoked by uid 99); 17 Feb 2015 20:21:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 20:21:11 +0000 Date: Tue, 17 Feb 2015 20:21:11 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@streams.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (STREAMS-288) StreamsJacksonModule should not scan for DateTimeFormats by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STREAMS-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14324813#comment-14324813 ] ASF GitHub Bot commented on STREAMS-288: ---------------------------------------- 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. > 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)