You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Michael Park (JIRA)" <ji...@apache.org> on 2016/02/01 06:23:39 UTC

[jira] [Commented] (MESOS-4566) Avoid unnecessary temporary `std::string` constructions and copies in `jsonify`.

    [ https://issues.apache.org/jira/browse/MESOS-4566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125777#comment-15125777 ] 

Michael Park commented on MESOS-4566:
-------------------------------------

{noformat}
commit 5e064503eb519aea3329f65f7ac93370b2910cc7
Author: Michael Park <mp...@apache.org>
Date:   Sun Jan 31 20:38:34 2016 -0800

    Avoid unnecessary string copies in `json` for protobuf messages.

    Review: https://reviews.apache.org/r/43024/
{noformat}
{noformat}
commit 8daa9a5c842a90b7b824a053c5f45897044de5fa
Author: Michael Park <mp...@apache.org>
Date:   Sun Jan 31 20:37:42 2016 -0800

    Avoid construction of temporary strings in `NumberWriter` for doubles.

    With this + https://reviews.apache.org/r/43024/, the number of calls to
    `operator new` and `operator delete` were reduced by roughly 1/3.

    Review: https://reviews.apache.org/r/43023/
{noformat}

> Avoid unnecessary temporary `std::string` constructions and copies in `jsonify`.
> --------------------------------------------------------------------------------
>
>                 Key: MESOS-4566
>                 URL: https://issues.apache.org/jira/browse/MESOS-4566
>             Project: Mesos
>          Issue Type: Improvement
>          Components: stout
>            Reporter: Michael Park
>            Assignee: Michael Park
>              Labels: mesosphere
>             Fix For: 0.28.0
>
>
> A few of the critical code paths in {{jsonify}} involve unnecessary temporary string construction and copies (inherited from the {{JSON::*}}). For example, {{strings::trim}} is used to remove trailing 0s from printing {{double}}s. We print {{double}}s a lot, and therefore constructing a temporary {{std::string}} on printing of every double is extremely costly. This ticket captures the work involved in avoiding them.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)