Details

    • Reviewed
    • beginner

    Description

      We have two means of getting at unsafe; UnsafeAccess and then internal to the Bytes class. They are effectively doing the same thing. We should have one avenue to Unsafe only.

      Many of our paths to Unsafe via UnsafeAccess traverse flags to check if access is available, if it is aligned and the order in which words are written on the machine. Each check costs – especially if done millions of times a second – and on occasion adds bloat in hot code paths. The unsafe access inside Bytes checks on startup what the machine is capable off and then does a static assign of the appropriate class-to-use from there on out. UnsafeAccess does not do this running the checks everytime. Would be good to have the Bytes behavior pervasive.

      The benefit of one access to Unsafe only is plain. The benefits we gain removing checks will be harder to measure though should be plain when you disassemble a hot-path; in a (very) rare case, the saved byte codes could be the difference between inlining or not.

      Attachments

        1. HBASE-20716.master.001.patch
          5 kB
          Sahil Aggarwal
        2. HBASE-20716.master.002.patch
          11 kB
          Sahil Aggarwal
        3. HBASE-20716.master.003.patch
          10 kB
          Sahil Aggarwal
        4. HBASE-20716.master.004.patch
          25 kB
          Sahil Aggarwal
        5. HBASE-20716.master.005.patch
          27 kB
          Sahil Aggarwal
        6. HBASE-20716.master.006.patch
          27 kB
          Sahil Aggarwal
        7. HBASE-20716.master.007.patch
          27 kB
          Sahil Aggarwal
        8. HBASE-20716.master.008.patch
          27 kB
          Sahil Aggarwal
        9. Screen Shot 2018-06-26 at 11.37.49 AM.png
          38 kB
          Michael Stack

        Activity

          People

            awked06 Sahil Aggarwal
            stack Michael Stack
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: