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

Suboptimal implementation of integer load / store InnoDB functions for big-endian architecture

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compiling
    • Labels:
    • Environment:
      ARM64

      Description

      InnoDB has its own inline functions to load/store integer values from/to memory. These
      functions make conversion between a host byte order and the big-endian representation
      because the InnoDB on-disk format is big-endian. Unfortunately, implementation of these
      functions could be translated by compiler to not optimal assembler code.
      The following Godbolt link https://godbolt.org/z/Bvm4hx shows how optimized and
      not-optimized functions look like after compiler generated assembler code.

      Moreover, implementation of mi_*() macros and inlined functions located in the file
      include/myisampack.h and implementation of mach_read_from_, mach_write_to_ functions
      from the file storage/innobase/include/mach0data.ic use direct manipulation with bytes array
      to store/load integers in big-endian representation instead of isolating such a code in
      standalone functions and calling them from functions mentioned above. That leads to code
      duplication and code bloating in a server binary.

      This bug report is to make optimization of source code for loading/storing integers in
      big-endian format and to refactor source code for storing/loading integers in big-endian
      format to avoid code duplication.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            dshulga Dmitry Shulga
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: