mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Simplify IO_CACHE by removing current_pos and end_pos as self-references
These self references were previously used to avoid having to check the IO_CACHE's type. However, a benchmark shows that on x86 5930k stock, the type comparison is marginally faster than the double pointer dereference. For 40 billion my_b_tell calls, the difference is .1 seconds in favor of performing the type check. (Basically there is no measurable difference) To prevent bugs from copying the structure using the equals(=) operator, and having to do the bookkeeping manually, remove these "convenience" variables.
This commit is contained in:
@ -93,7 +93,7 @@ IO_CACHE info;
|
||||
#define CACHE_SIZE 16384
|
||||
|
||||
#define INFO_TAIL ", pos_in_file = %llu, pos_in_mem = %lu", \
|
||||
info.pos_in_file, (ulong) (*info.current_pos - info.request_pos)
|
||||
info.pos_in_file, (ulong) ((info.type == READ_CACHE ? info.read_pos : info.write_pos) - info.request_pos)
|
||||
|
||||
#define FILL 0x5A
|
||||
|
||||
|
Reference in New Issue
Block a user