mariadb/unittest/mysys
Monty b5d65fc105 Optimize performance of my_bitmap
MDEV-33502 Slowdown when running nested statement with many partitions

This change was triggered to help some MariaDB users with close to
10000 bits in their bitmaps.

- Change underlaying storage to be 64 bit instead of 32bit.
  - This reduses number of loops to scan bitmaps.
  - This can cause some bitmaps to be 4 byte large.
- Ensure that all not used top-bits are always 0 (simplifes code as
  the last 64 bit storage is not a special case anymore).
- Use my_find_first_bit() to find the first set bit which is much faster
  than scanning trough things byte by byte and then bit by bit.

Other things:
- Added a bool to remember if my_bitmap_init() did allocate the bitmap
  array. my_bitmap_free() will only free arrays it did allocate.
  This allowed me to remove setting 'bitmap=0' before calling
  my_bitmap_free() for cases where the bitmap's where allocated externally.
- my_bitmap_init() sets bitmap to 0 in case of failure.
- Added 'universal' asserts to most bitmap functions.
- Change all remaining calls to bitmap_init() to my_bitmap_init().
  - To finish the change from 2014.
- Changed all usage of uint32 in my_bitmap.h to my_bitmap_map.
- Updated bitmap_copy() to handle bitmaps of different size.
- Removed const from bitmap_exists_intersection() as this caused casts
  on all usage.
- Removed not used function bitmap_set_above().
- Renamed create_last_word_mask() to create_last_bit_mask() (to match
  name changes in my_bitmap.cc)
- Extended bitmap-t with test for more bitmap functions.
2024-02-27 14:51:33 +02:00
..
aes-t.c MDEV-25785 Add support for OpenSSL 3.0 2022-05-23 15:27:51 +02:00
base64-t.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
bitmap-t.c Optimize performance of my_bitmap 2024-02-27 14:51:33 +02:00
byte_order-t.c Fixed compiler warnings from gcc 7.4.1 2020-01-29 23:23:55 +02:00
CMakeLists.txt MDEV-19935 Create unified CRC-32 interface 2020-09-17 16:07:37 +02:00
crc32-t.c Fix GCC warning: this decimal constant is unsigned only in ISO C90 2020-09-24 13:08:43 +02:00
dynstring-t.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
lf-t.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
ma_dyncol-t.c Change CHARSET_INFO character set and collaction names to LEX_CSTRING 2021-05-19 22:54:07 +02:00
my_atomic-t.c Shrink my_atomic.h and my_cpu.h scope 2020-04-15 22:23:03 +04:00
my_delete-t.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_getopt-t.c unittest: my_getopt-t errors on -ve ul{l,} 2021-04-07 14:05:04 +10:00
my_malloc-t.c perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
my_rdtsc-t.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_vsnprintf-t.c Add support for minimum field width for strings to my_vsnprintf() 2021-05-19 22:27:29 +02:00
queues-t.c Merge branch '5.5' into 10.1 2020-04-30 17:36:41 +02:00
stacktrace-t.c MDEV-24131: unittest stacktrace-t fails to compile (OpenBSD) 2021-01-28 13:27:00 +11:00
thr_template.c Merge branch '10.3' into 10.4 2021-12-07 09:47:42 +01:00
waiting_threads-t.c Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00