Skip to content

Commit 2fed871

Browse files
author
Abhinav Agarwal
committed
Bug#35610709 - Binlog Iteration is slow due to unnecessary memset calls.
Issue: - Binlog iterator API get(), calls memset() before retrieving reading binlog event or some other information. - Since API always keep track of the length of the buffer read, memset() call is unnecessary. - These memset() can slow down the reading of binlog events. Solution: - Removed the unnecessary memset() calls. Change-Id: I373ef5e4f7f180268d504ea4da6cdb86037d0f09
1 parent b081ef0 commit 2fed871

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

sql/binlog/services/iterator/file_storage.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ class Binlog_iterator_ctx {
335335
auto saved_pos{reader.position()};
336336

337337
unsigned char buffer[LOG_EVENT_HEADER_LEN];
338-
memset(buffer, 0, LOG_EVENT_HEADER_LEN);
339338

340339
while (true) {
341340
// save the position so that we can seek to it later on
@@ -368,8 +367,6 @@ class Binlog_iterator_ctx {
368367
unsigned int bytes_read{0};
369368
unsigned char gtid_buffer_stack
370369
[mysql::binlog::event::Gtid_event::MAX_EVENT_LENGTH];
371-
memset(gtid_buffer_stack, 0,
372-
mysql::binlog::event::Gtid_event::MAX_EVENT_LENGTH);
373370
unsigned char *gtid_buffer = gtid_buffer_stack;
374371

375372
// swap buffer in the context
@@ -639,7 +636,6 @@ DEFINE_METHOD(Binlog_iterator_service_get_status, FileStorage::get,
639636
auto &ctx = *it->m_ctx;
640637
auto &reader = ctx.get_reader();
641638
*bytes_read = 0;
642-
memset(buffer, 0, buffer_capacity);
643639

644640
// update the file cursor (and get the event size, which we can disregard
645641
// here)

0 commit comments

Comments
 (0)