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

Reduce THD size by refactoring THD::ha_data

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      THD size is currently around 27KiB. Among them, THD::ha_data is an array of 64 slots, totaling 4KiB.

      We barely use more than 3 slots at a time, so keeping memory for every possible Ha_data representative is pretty much space-inefficient.

      We still need an array organization for some fast checks (i.e. check if this engine is enabled in transaction).

      We could reorganize ha_data access as follows:

      1. ha_data becomes an array of 64 single-byte integers.
      2. when engine is registered in transaction, its Ha_data is appended to a dynamic array and the new index is put in the array.
      3. Otherwise the array slot contains 0xff.
      4. Optionally, we can keep a pre-allocated object for one or two engines

      Space saved is 3.9Kib without micro-performance tradeoffs.

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            nikitamalyavin Nikita Malyavin
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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