Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-9786

API improvements for get_key and get_value

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.2.0, 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 5
    • Storage Engines - 2022-12-12, Storage Engines - 2023-01-10, StorEng - 2023-01-24

      Summary
      Performance analysis of some queries has shown that a lot of time is spent in WT_CURSOR->get_key and WT_CURSOR->get_value.  Some of the time is due to how these vararg functions are coded, and in how the va_list is passed to a subordinate function.  For the specific MongoDB case where the key format and value format are both "u", there are much cheaper ways to assigning to the (single) output argument.

      This came out of a slack discussion initiated by ian.boros@mongodb.com.

      Three specific approaches have been mentioned:

      • Add a new API call (WT_CURSOR->get_raw_key_value?) to get both key and value in "raw" form (format "u").
      • Notice on cursor open that we have "u" format and change the get_value and/or get_key "virtual functions" to specialized versions that are declared with var_args, but coded efficiently for this case.
      • Same as previous, but specialized versions are declared with a WT_ITEM * argument.  Not strictly ANSI-C, but is likely valid on many platforms.  We would limit the implementation to only verified platforms.

            Assignee:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Reporter:
            donald.anderson@mongodb.com Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: