Merge pull request #6653 from yandex/speed-up-memory-tracker

Speed up MemoryTracker by function inlining
This commit is contained in:
alexey-milovidov 2019-08-25 04:55:46 +03:00 committed by GitHub
commit d0555d8eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -51,12 +51,6 @@ MemoryTracker * CurrentThread::getMemoryTracker()
return &current_thread->memory_tracker; return &current_thread->memory_tracker;
} }
Int64 & CurrentThread::getUntrackedMemory()
{
/// It assumes that (current_thread != nullptr) is already checked with getMemoryTracker()
return current_thread->untracked_memory;
}
void CurrentThread::updateProgressIn(const Progress & value) void CurrentThread::updateProgressIn(const Progress & value)
{ {
if (unlikely(!current_thread)) if (unlikely(!current_thread))

View File

@ -52,7 +52,12 @@ public:
static ProfileEvents::Counters & getProfileEvents(); static ProfileEvents::Counters & getProfileEvents();
static MemoryTracker * getMemoryTracker(); static MemoryTracker * getMemoryTracker();
static Int64 & getUntrackedMemory();
static inline Int64 & getUntrackedMemory()
{
/// It assumes that (current_thread != nullptr) is already checked with getMemoryTracker()
return current_thread->untracked_memory;
}
/// Update read and write rows (bytes) statistics (used in system.query_thread_log) /// Update read and write rows (bytes) statistics (used in system.query_thread_log)
static void updateProgressIn(const Progress & value); static void updateProgressIn(const Progress & value);