Uploaded image for project: 'Spymemcached Java Client'
  1. Spymemcached Java Client
  2. SPY-127

Address performance of try/catch in isJSONObject checks

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.11.0
    • None
    • library
    • Security Level: Public
    • None

    Description

      I'm using the CouchBase Java Client and when performing large amounts of set's, the net.spy.memcached.util.StringUtils.isJsonObject() shows up a lot in my profiler as a performance bottleneck due to the overhead of catching exceptions related to attempting to cast strings to an Integer.

      Use a different method of determining whether the incoming string is numeric that doesn't involve throwing and catching errors.

      There are a couple different tickets in existence that suggest this entire method has serious issues and should be scrapped, but I'm unclear on the official response to that since one of the tickets is closed as a duplicate and the other is closed but seems completely unrelated.
      http://www.couchbase.com/issues/browse/JCBC-48
      http://www.couchbase.com/issues/browse/JCBC-41

      Attachments

        Issue Links

          For Gerrit Dashboard: SPY-127
          # Subject Branch Project Status CR V

          Activity

            People

              daschl Michael Nitschinger
              bdw429s Brad Wood
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty