summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-06-18 19:48:57 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-06-28 15:23:36 +0300
commit90038693903044bbbf7946ac128c3757ad33d7ba (patch)
treef3596c10eae1ed4d48ba5e4e6324ec5c63923aba /sql
parentb3171607e3e3024ea493c785831a7421a36fa7fe (diff)
downloadmariadb-git-90038693903044bbbf7946ac128c3757ad33d7ba.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/filesort.cc3
1 files changed, 0 insertions, 3 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 83c8442937e..2388dd759b5 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1483,8 +1483,6 @@ int merge_many_buff(Sort_param *param, uchar *sort_buffer,
if (flush_io_cache(to_file))
break; /* purecov: inspected */
temp=from_file; from_file=to_file; to_file=temp;
- setup_io_cache(from_file);
- setup_io_cache(to_file);
*maxbuffer= (uint) (lastbuff-buffpek)-1;
}
cleanup:
@@ -1492,7 +1490,6 @@ cleanup:
if (to_file == t_file)
{
*t_file=t_file2; // Copy result file
- setup_io_cache(t_file);
}
DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */