Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Fix Version/s: 2.0.1
    • Component/s: Core
    • Labels:
      None

      Description

      Currently getting data to and from offheap is slow due to individual calls to getByte() and putByte()

      The following patch makes this a single call and is 10x faster

      benchmark:
           [java]  0% Scenario{vm=java, trial=0, benchmark=GetBytesOld} 82266.48 ns; σ=2532.87 ns @ 10 trials
           [java] 50% Scenario{vm=java, trial=0, benchmark=GetBytesNew} 7876.95 ns; σ=489.78 ns @ 10 trials
           [java]
           [java]   benchmark    us linear runtime
           [java] GetBytesOld 82.27 ==============================
           [java] GetBytesNew  7.88 ==
           [java]
           [java] vm: java
           [java] trial: 0
      
      1. memfix.txt
        1.0 kB
        T Jake Luciani
      2. memperf.txt
        1 kB
        T Jake Luciani

        Activity

        Hide
        Jonathan Ellis added a comment -

        Nice! LGTM (with spaces around operators, please .

        Show
        Jonathan Ellis added a comment - Nice! LGTM (with spaces around operators, please .
        Hide
        T Jake Luciani added a comment -

        committed

        Show
        T Jake Luciani added a comment - committed
        Hide
        Colin Taylor added a comment -

        Can we get this backported to 1.2? Cheers.

        Show
        Colin Taylor added a comment - Can we get this backported to 1.2? Cheers.
        Hide
        Jonathan Ellis added a comment -

        The backport is trivial but we're only applying bugfixes to 1.2 at this point. If you want the latest and greatest, 2.0 will be out shortly!

        Show
        Jonathan Ellis added a comment - The backport is trivial but we're only applying bugfixes to 1.2 at this point. If you want the latest and greatest, 2.0 will be out shortly!
        Hide
        Colin Taylor added a comment -

        Not sure this isn't a bugfix

        Show
        Colin Taylor added a comment - Not sure this isn't a bugfix
        Hide
        Marcus Eriksson added a comment -

        this broke the RowCache:
        [junit] Testcase: testRowCache(org.apache.cassandra.db.RowCacheTest): FAILED
        [junit] null
        [junit] junit.framework.AssertionFailedError
        [junit] at org.apache.cassandra.db.RowCacheTest.testRowCache(RowCacheTest.java:92)

        debugging a bit shows that the column value returned is "key0" where it should be "val0"

        Show
        Marcus Eriksson added a comment - this broke the RowCache: [junit] Testcase: testRowCache(org.apache.cassandra.db.RowCacheTest): FAILED [junit] null [junit] junit.framework.AssertionFailedError [junit] at org.apache.cassandra.db.RowCacheTest.testRowCache(RowCacheTest.java:92) debugging a bit shows that the column value returned is "key0" where it should be "val0"
        Hide
        T Jake Luciani added a comment -

        Attached fix, it wan't accounting for buffer offsets. Test passes now, can you verify?

        Show
        T Jake Luciani added a comment - Attached fix, it wan't accounting for buffer offsets. Test passes now, can you verify?
        Hide
        Marcus Eriksson added a comment -

        yep, looks good

        Show
        Marcus Eriksson added a comment - yep, looks good
        Hide
        T Jake Luciani added a comment -

        committed fix

        Show
        T Jake Luciani added a comment - committed fix

          People

          • Assignee:
            T Jake Luciani
            Reporter:
            T Jake Luciani
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development