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 3E60D17C6A for ; Tue, 17 Feb 2015 20:21:23 +0000 (UTC) Received: (qmail 68477 invoked by uid 500); 17 Feb 2015 20:21:20 -0000 Delivered-To: apmail-streams-dev-archive@streams.apache.org Received: (qmail 68435 invoked by uid 500); 17 Feb 2015 20:21:20 -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 68424 invoked by uid 99); 17 Feb 2015 20:21:19 -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:19 +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:18 +0000 Received: (qmail 67137 invoked by uid 99); 17 Feb 2015 20:20:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 20:20:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 61FA7E0779; Tue, 17 Feb 2015 20:20:58 +0000 (UTC) From: steveblackmon To: dev@streams.incubator.apache.org Reply-To: dev@streams.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-streams pull request: STREAMS-288 | Removing default beh... Content-Type: text/plain Message-Id: <20150217202058.61FA7E0779@git1-us-west.apache.org> Date: Tue, 17 Feb 2015 20:20:58 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org 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. ---