Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23002

Replace bool's with bitmaps in Item and THD

    XMLWordPrintable

Details

    Description

      Replace bool in Item and THD with bitmap.

      In THD and Item (the base class) we have a lot of bool variables.
      We should try to replace these with a bitmap to save space
      (and allow the compiler to clear/set several variables with one memory access)

      in my_tree.h we have an example bitmap of how to do it:

        uint32 count:31,
      	        colour:1;
      

      I think it's ok to use ulonglong variables for the bitmaps.

      It's ok to to also group variables in THD and Item so that all variables of the same size are together (this will save space as there is less holes between variables). However variables that
      are obviously used together should be kept together (to get better memory caching).

      As part of the task is to do:

      • Run gdb and check the sizeof before and after on THD and some Item.
      • Check the size of the mysqld binary before and after the change
      • run sql-bench test and record the changes before and after the change
      • Ask Axel (at the benchmark team) to run a simple benchmark to verify the change
        All of the above results should be added to this Jira entry and be checked by the reviewer before approving this task..
        (I don't expect any notable performance impact)

      Attachments

        Activity

          People

            monty Michael Widenius
            monty Michael Widenius
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.