Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-19149

Implement Value.WriteJSON()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.5.1, 5.0.0
    • 4.5.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      I have a proposed solution to the performance issues with Value.MarshalJSON().

      I believe that most of the cost is due to malloc() and garbage collection. So in addition to Value.MarshalJSON(), I am proposing a new method Value.WriteJSON() to be used in writeResults(), instead of Value.MarshalJSON().

      Value.WriteJSON() would allocate zero or minimal memory.

      Here is the signature:

      Value.WriteJSON(w io.Writer, prefix, indent string) error

      If pretty = false, we would set prefix and indent to “”.

      If this sounds interesting, you can take a look and do some experiments and measurements for Watson, or a quick follow on release.

      Thanks,
      Gerald

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Sitaram.Vemulapalli Sitaram Vemulapalli
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty