Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2318

Refactor view queries to be strongly typed

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • library
    • None
    • 1

    Description

      Delaying deserialization of view result row keys and values until explicitly requested has very little value. The deserializer is still required to deserialize the rows, it just does so onto a dynamic object such as a JToken. This is adding more heap allocations, and adding an extra step to convert that to a POCO when Value<T> or Key<T> is called later. It is also interfering with fallbacks for non-streaming deserializers, which need to deserialize the whole response in one shot.

      Instead, we can use strongly-typed results of IViewRow<TKey, TValue> which allows the deserializer to create the POCO directly.

      Note: This is a PoC change for consideration.

      Attachments

        For Gerrit Dashboard: NCBC-2318
        # Subject Branch Project Status CR V

        Activity

          btburnett3 Brant Burnett created issue -
          btburnett3 Brant Burnett made changes -
          Field Original Value New Value
          Status New [ 10003 ] Open [ 1 ]
          btburnett3 Brant Burnett made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          btburnett3 Brant Burnett made changes -
          Description Delaying deserialization of view result row keys and values until explicitly requested has very little value. The deserializer is still required to deserialize the rows, it just does so onto a dynamic object such as a JToken. This is adding more heap allocations, and adding an extra step to convert that to a POCO when Value<T> or Key<T> is called later. It is also interfering with fallbacks for non-streaming deserializers, which need to deserialize the whole response in one shot.

          Instead, we can use strongly-typed results of IViewRow<TKey, TValue> which allows the deserializer to create the POCO directly.
          Delaying deserialization of view result row keys and values until explicitly requested has very little value. The deserializer is still required to deserialize the rows, it just does so onto a dynamic object such as a JToken. This is adding more heap allocations, and adding an extra step to convert that to a POCO when Value<T> or Key<T> is called later. It is also interfering with fallbacks for non-streaming deserializers, which need to deserialize the whole response in one shot.

          Instead, we can use strongly-typed results of IViewRow<TKey, TValue> which allows the deserializer to create the POCO directly.

          Note: This is a PoC change for consideration.
          jmorris Jeff Morris made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          brett19 Brett Lawson made changes -
          Story Points 1

          People

            btburnett3 Brant Burnett
            btburnett3 Brant Burnett
            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