Print compress/decompress info

* show source code size and tick (time) of each compression/decompression

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
HyukWoo Park 2022-09-28 15:29:15 +09:00
commit 205b5f35bd
2 changed files with 6 additions and 1 deletions

View file

@ -216,6 +216,9 @@ bool CompressibleString::compressWorker()
size_t totalDecompLength = 0;
int lastBoundLength = 0;
char* tempBuffer = nullptr;
ESCARGOT_LOG_INFO("COMPRESS TICK: %" PRIu64 " Size: %zu\n", currentTick, originByteLength);
for (size_t srcIndex = 0; srcIndex < originByteLength; srcIndex += g_compressChunkSize) {
int srcSize = (int)std::min(g_compressChunkSize, originByteLength - srcIndex);
int boundLength = LZ4::LZ4_compressBound(srcSize);
@ -304,6 +307,8 @@ void CompressibleString::decompressWorker()
m_vmInstance->compressibleStringsUncomressedBufferSize() += decomressedBufferSize();
ASSERT(originByteLength > totalDecompLength);
m_vmInstance->increaseSourceSize(originByteLength - totalDecompLength);
ESCARGOT_LOG_INFO("DECOMPRESS TICK: %" PRIu64 " Size: %zu\n", fastTickCount(), originByteLength);
}
} // namespace Escargot

View file

@ -948,7 +948,7 @@ static void printGCMemory(void* data)
if (currentTick - g_lastTick >= g_dumpInterval) {
g_lastTick = currentTick;
VMInstanceRef* vm = static_cast<VMInstanceRef*>(data);
printf("Tick %" PRIu64 ": %f MB %lu \n", fastTickCount(), Memory::heapSize() / 1024.f / 1024.f, vm->validSourceSize());
printf("Tick %" PRIu64 ": %f MB %lu \n", currentTick, Memory::heapSize() / 1024.f / 1024.f, vm->validSourceSize());
}
}