<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<style>
	body {margin: 0; padding: 10px; background-color: #ffffff}
	h1 {margin: 5px 0 0 0; font-size: 18px; font-weight: normal; text-align: center}
	header {margin: -24px 0 5px 0; line-height: 24px}
	button {font: 12px sans-serif; cursor: pointer}
	p {margin: 5px 0 5px 0}
	a {color: #0366d6}
	#hl {position: absolute; display: none; overflow: hidden; white-space: nowrap; pointer-events: none; background-color: #ffffe0; outline: 1px solid #ffc000; height: 15px}
	#hl span {padding: 0 3px 0 3px}
	#status {overflow: hidden; white-space: nowrap}
	#match {overflow: hidden; white-space: nowrap; display: none; float: right; text-align: right}
	#reset {cursor: pointer}
	#canvas {width: 100%; height: 480px}
</style>
</head>
<body style='font: 12px Verdana, sans-serif'>
<h1>CPU profile</h1>
<header style='text-align: left'><button id='reverse' title='Reverse'>&#x1f53b;</button>&nbsp;&nbsp;<button id='search' title='Search'>&#x1f50d;</button></header>
<header style='text-align: right'>Produced by <a href='https://github.com/jvm-profiling-tools/async-profiler'>async-profiler</a></header>
<canvas id='canvas'></canvas>
<div id='hl'><span></span></div>
<p id='match'>Matched: <span id='matchval'></span> <span id='reset' title='Clear'>&#x274c;</span></p>
<p id='status'>&nbsp;</p>
<script>
	// Copyright 2020 Andrei Pangin
	// Licensed under the Apache License, Version 2.0.
	'use strict';
	var root, rootLevel, px, pattern;
	var reverse = false;
	const levels = Array(30);
	for (let h = 0; h < levels.length; h++) {
		levels[h] = [];
	}

	const canvas = document.getElementById('canvas');
	const c = canvas.getContext('2d');
	const hl = document.getElementById('hl');
	const status = document.getElementById('status');

	const canvasWidth = canvas.offsetWidth;
	const canvasHeight = canvas.offsetHeight;
	canvas.style.width = canvasWidth + 'px';
	canvas.width = canvasWidth * (devicePixelRatio || 1);
	canvas.height = canvasHeight * (devicePixelRatio || 1);
	if (devicePixelRatio) c.scale(devicePixelRatio, devicePixelRatio);
	c.font = document.body.style.font;

	const palette = [
		[0xb2e1b2, 20, 20, 20],
		[0x50e150, 30, 30, 30],
		[0x50cccc, 30, 30, 30],
		[0xe15a5a, 30, 40, 40],
		[0xc8c83c, 30, 30, 10],
		[0xe17d00, 30, 30,  0],
		[0xcce880, 20, 20, 20],
	];

	function getColor(p) {
		const v = Math.random();
		return '#' + (p[0] + ((p[1] * v) << 16 | (p[2] * v) << 8 | (p[3] * v))).toString(16);
	}

	function f(level, left, width, type, title, inln, c1, int) {
		levels[level].push({left: left, width: width, color: getColor(palette[type]), title: title,
			details: (int ? ', int=' + int : '') + (c1 ? ', c1=' + c1 : '') + (inln ? ', inln=' + inln : '')
		});
	}

	function samples(n) {
		return n === 1 ? '1 sample' : n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' samples';
	}

	function pct(a, b) {
		return a >= b ? '100' : (100 * a / b).toFixed(2);
	}

	function findFrame(frames, x) {
		let left = 0;
		let right = frames.length - 1;

		while (left <= right) {
			const mid = (left + right) >>> 1;
			const f = frames[mid];

			if (f.left > x) {
				right = mid - 1;
			} else if (f.left + f.width <= x) {
				left = mid + 1;
			} else {
				return f;
			}
		}

		if (frames[left] && (frames[left].left - x) * px < 0.5) return frames[left];
		if (frames[right] && (x - (frames[right].left + frames[right].width)) * px < 0.5) return frames[right];

		return null;
	}

	function search(r) {
		if (r === true && (r = prompt('Enter regexp to search:', '')) === null) {
			return;
		}

		pattern = r ? RegExp(r) : undefined;
		const matched = render(root, rootLevel);
		document.getElementById('matchval').textContent = pct(matched, root.width) + '%';
		document.getElementById('match').style.display = r ? 'inherit' : 'none';
	}

	function render(newRoot, newLevel) {
		if (root) {
			c.fillStyle = '#ffffff';
			c.fillRect(0, 0, canvasWidth, canvasHeight);
		}

		root = newRoot || levels[0][0];
		rootLevel = newLevel || 0;
		px = canvasWidth / root.width;

		const x0 = root.left;
		const x1 = x0 + root.width;
		const marked = [];

		function mark(f) {
			return marked[f.left] >= f.width || (marked[f.left] = f.width);
		}

		function totalMarked() {
			let total = 0;
			let left = 0;
			Object.keys(marked).sort(function(a, b) { return a - b; }).forEach(function(x) {
				if (+x >= left) {
					total += marked[x];
					left = +x + marked[x];
				}
			});
			return total;
		}

		function drawFrame(f, y, alpha) {
			if (f.left < x1 && f.left + f.width > x0) {
				c.fillStyle = pattern && f.title.match(pattern) && mark(f) ? '#ee00ee' : f.color;
				c.fillRect((f.left - x0) * px, y, f.width * px, 15);

				if (f.width * px >= 21) {
					const chars = Math.floor(f.width * px / 7);
					const title = f.title.length <= chars ? f.title : f.title.substring(0, chars - 2) + '..';
					c.fillStyle = '#000000';
					c.fillText(title, Math.max(f.left - x0, 0) * px + 3, y + 12, f.width * px - 6);
				}

				if (alpha) {
					c.fillStyle = 'rgba(255, 255, 255, 0.5)';
					c.fillRect((f.left - x0) * px, y, f.width * px, 15);
				}
			}
		}

		for (let h = 0; h < levels.length; h++) {
			const y = reverse ? h * 16 : canvasHeight - (h + 1) * 16;
			const frames = levels[h];
			for (let i = 0; i < frames.length; i++) {
				drawFrame(frames[i], y, h < rootLevel);
			}
		}

		return totalMarked();
	}

	canvas.onmousemove = function() {
		const h = Math.floor((reverse ? event.offsetY : (canvasHeight - event.offsetY)) / 16);
		if (h >= 0 && h < levels.length) {
			const f = findFrame(levels[h], event.offsetX / px + root.left);
			if (f) {
				if (f != root) getSelection().removeAllRanges();
				hl.style.left = (Math.max(f.left - root.left, 0) * px + canvas.offsetLeft) + 'px';
				hl.style.width = (Math.min(f.width, root.width) * px) + 'px';
				hl.style.top = ((reverse ? h * 16 : canvasHeight - (h + 1) * 16) + canvas.offsetTop) + 'px';
				hl.firstChild.textContent = f.title;
				hl.style.display = 'block';
				canvas.title = f.title + '\n(' + samples(f.width) + f.details + ', ' + pct(f.width, levels[0][0].width) + '%)';
				canvas.style.cursor = 'pointer';
				canvas.onclick = function() {
					if (f != root) {
						render(f, h);
						canvas.onmousemove();
					}
				};
				status.textContent = 'Function: ' + canvas.title;
				return;
			}
		}
		canvas.onmouseout();
	}

	canvas.onmouseout = function() {
		hl.style.display = 'none';
		status.textContent = '\xa0';
		canvas.title = '';
		canvas.style.cursor = '';
		canvas.onclick = '';
	}

	canvas.ondblclick = function() {
		getSelection().selectAllChildren(hl);
	}

	document.getElementById('reverse').onclick = function() {
		reverse = !reverse;
		render();
	}

	document.getElementById('search').onclick = function() {
		search(true);
	}

	document.getElementById('reset').onclick = function() {
		search(false);
	}

	window.onkeydown = function() {
		if (event.ctrlKey && event.keyCode === 70) {
			event.preventDefault();
			search(true);
		} else if (event.keyCode === 27) {
			search(false);
		}
	}

f(0,0,295,3,'all')
f(1,0,7,3,'/usr/lib/x86_64-linux-gnu/libc.so.6')
f(2,0,7,3,'thread_native_entry(Thread*)')
f(3,0,7,4,'Thread::call_run()')
f(4,0,7,4,'JavaThread::thread_main_inner()')
f(5,0,7,4,'CompileBroker::compiler_thread_loop()')
f(6,0,7,4,'CompileBroker::invoke_compiler_on_method(CompileTask*)')
f(7,0,7,4,'C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)')
f(8,0,7,4,'Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)')
f(9,0,4,4,'Compile::Code_Gen()')
f(10,0,1,4,'Matcher::match()')
f(11,0,1,4,'Matcher::xform(Node*, int)')
f(12,0,1,4,'Matcher::match_tree(Node const*)')
f(13,0,1,4,'Matcher::ReduceInst(State*, int, Node*&)')
f(14,0,1,4,'Matcher::ReduceInst_Interior(State*, int, Node*&, MachNode*, unsigned int)')
f(15,0,1,4,'Matcher::ReduceInst(State*, int, Node*&)')
f(16,0,1,4,'Matcher::ReduceInst_Interior(State*, int, Node*&, MachNode*, unsigned int)')
f(17,0,1,4,'Matcher::ReduceInst(State*, int, Node*&)')
f(18,0,1,4,'Matcher::ReduceInst_Interior(State*, int, Node*&, MachNode*, unsigned int)')
f(19,0,1,4,'xorL_rRegNode::Expand(State*, Node_List&, Node*)')
f(10,1,1,4,'PhaseCFG::do_global_code_motion()')
f(11,1,1,4,'PhaseCFG::global_code_motion()')
f(12,1,1,4,'PhaseIFG::init(unsigned int)')
f(13,1,1,4,'IndexSet::initialize(unsigned int)')
f(10,2,2,4,'PhaseChaitin::Register_Allocate()')
f(11,2,1,4,'PhaseChaitin::gather_lrg_masks(bool)')
f(12,2,1,4,'RegMask::is_misaligned_pair() const')
f(11,3,1,4,'PhaseChaitin::post_allocate_copy_removal()')
f(9,4,2,4,'Compile::Optimize()')
f(10,4,2,4,'PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)')
f(11,4,2,4,'PhaseIdealLoop::build_and_optimize(LoopOptsMode)')
f(12,4,1,4,'PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)')
f(12,5,1,4,'PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)')
f(13,5,1,4,'PhaseIdealLoop::build_loop_late_post_work(Node*, bool)')
f(9,6,1,4,'ParseGenerator::generate(JVMState*)')
f(10,6,1,4,'Parse::Parse(JVMState*, ciMethod*, float)')
f(11,6,1,4,'Parse::do_all_blocks()')
f(12,6,1,4,'Parse::do_one_block()')
f(13,6,1,4,'Parse::do_checkcast()')
f(14,6,1,4,'GraphKit::gen_checkcast(Node*, Node*, Node**)')
f(1,7,24,3,'[not_walkable_Java]')
f(2,7,14,1,'I2C/C2I adapters')
f(3,7,1,4,'CompiledMethod::is_compiled() const')
f(3,8,1,4,'Method::from_compiled_entry_no_trampoline() const')
f(3,9,12,4,'SharedRuntime::fixup_callers_callsite(Method*, unsigned char*)')
f(4,10,3,4,'CodeCache::find_blob(void*)')
f(4,13,7,4,'CodeHeap::find_blob_unsafe(void*) const')
f(4,20,1,4,'nmethod::is_zombie() const')
f(2,21,10,3,'Interpreter')
f(1,31,1,3,'[unknown]')
f(2,31,1,3,'/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2')
f(1,32,47,3,'[unknown_Java]')
f(2,32,45,1,'I2C/C2I adapters')
f(2,77,2,3,'Interpreter')
f(1,79,216,1,'java/lang/Thread.run')
f(2,79,216,1,'java/util/concurrent/ThreadPoolExecutor$Worker.run')
f(3,79,216,1,'java/util/concurrent/ThreadPoolExecutor.runWorker')
f(4,79,216,1,'kyo/concurrent/scheduler/Scheduler$$$Lambda$53.0x0000000800d1bd18.run')
f(5,79,216,1,'kyo/concurrent/scheduler/Scheduler$.startWorkers$$anonfun$1')
f(6,79,216,1,'kyo/concurrent/scheduler/Worker.runWorker')
f(7,80,129,1,'kyo/concurrent/scheduler/IOTask.run',4,0,0)
f(8,80,129,1,'kyo/concurrent/scheduler/IOTask.eval',4,0,0)
f(9,87,2,6,'kyo/concurrent/scheduler/IOTask.loop$2',0,2,0)
f(10,87,2,2,'java/lang/invoke/Invokers$Holder.linkToTargetMethod',2,0,0)
f(11,87,2,2,'java/lang/invoke/DirectMethodHandle$Holder.newInvokeSpecial',2,0,0)
f(12,87,1,2,'java/lang/invoke/DirectMethodHandle.allocateInstance',1,0,0)
f(12,88,1,2,'kyo/concurrent/scheduler/IOTask$$Lambda$66.0x0000000800d4d270.<init>',1,0,0)
f(9,89,1,1,'kyo/concurrent/scheduler/IOTask.loop$8')
f(10,89,1,1,'kyo/concurrent/scheduler/IOPromise.kyo$concurrent$scheduler$IOPromise$$inline$complete')
f(11,89,1,1,'kyo/concurrent/scheduler/IOPromise.complete')
f(12,89,1,1,'java/util/concurrent/atomic/AtomicReference.compareAndSet')
f(13,89,1,1,'java/lang/invoke/VarHandleGuards.guard_LLL_Z')
f(14,89,1,1,'java/lang/invoke/VarHandleReferences$FieldInstanceReadWrite.compareAndSet')
f(9,90,114,1,'kyo/core$$anon$5.apply')
f(10,90,3,1,'kyo/bench/ForkManyBench$$anon$1.apply')
f(11,90,3,2,'kyo/bench/ForkManyBench$$anon$1.apply',3,0,0)
f(12,90,3,2,'scala/runtime/BoxesRunTime.boxToInteger',3,0,0)
f(13,92,1,2,'java/lang/Integer.valueOf',1,0,0)
f(10,93,104,1,'kyo/core$$anon$5.apply')
f(11,94,95,1,'kyo/core$$anon$5.apply')
f(12,96,91,1,'kyo/core$.kyo$core$$$_$transformLoop$1',4,0,0)
f(13,98,2,3,'itable stub')
f(13,100,87,1,'kyo/concurrent/fibers$Fibers$$Lambda$38.0x0000000800c3ea00.apply')
f(14,101,86,1,'kyo/concurrent/fibers$Fibers.forkFiber$$anonfun$1',15,0,0)
f(15,102,2,2,'kyo/concurrent/fibers$Fiber$.promise',2,0,0)
f(15,104,6,2,'kyo/concurrent/scheduler/IOTask.<init>',6,0,0)
f(16,109,1,2,'kyo/concurrent/scheduler/IOPromise.<init>',1,0,0)
f(15,110,77,1,'kyo/concurrent/scheduler/Scheduler$.schedule',6,0,0)
f(16,110,77,1,'kyo/concurrent/scheduler/Worker.enqueueLocal',6,0,0)
f(17,110,77,1,'kyo/concurrent/scheduler/Queue.offer',6,0,0)
f(18,110,77,1,'kyo/concurrent/scheduler/Queue.tryModify',6,0,0)
f(19,110,4,2,'java/util/concurrent/atomic/AtomicBoolean.compareAndSet',4,0,0)
f(20,110,4,2,'java/lang/invoke/VarHandleGuards.guard_LII_Z',4,0,0)
f(21,110,4,2,'java/lang/invoke/VarHandleInts$FieldInstanceReadWrite.compareAndSet',4,0,0)
f(19,114,73,1,'scala/Function0.apply$mcZ$sp',2,0,0)
f(20,114,73,1,'kyo/concurrent/scheduler/Queue$$Lambda$55.0x0000000800d45b00.apply',2,0,0)
f(21,114,73,1,'kyo/concurrent/scheduler/Queue.offer$$anonfun$1',2,0,0)
f(22,114,2,2,'kyo/concurrent/scheduler/Queue.queue',2,0,0)
f(22,116,71,1,'scala/collection/mutable/PriorityQueue.addOne')
f(23,119,17,2,'scala/collection/mutable/PriorityQueue$ResizableArrayAccess.p_ensureAdditionalSize',17,0,0)
f(24,119,17,2,'scala/collection/mutable/ArrayBuffer.ensureAdditionalSize',17,0,0)
f(25,119,17,2,'scala/collection/mutable/ArrayBuffer.array_$eq',17,0,0)
f(23,136,51,2,'scala/collection/mutable/PriorityQueue.fixUp',51,0,0)
f(24,144,7,2,'kyo/concurrent/scheduler/IOTask$TaskOrdering$.lt',7,0,0)
f(25,150,1,2,'kyo/concurrent/scheduler/IOTask$TaskOrdering$.lt',1,0,0)
f(24,151,32,2,'scala/collection/mutable/PriorityQueue$ResizableArrayAccess.p_swap',32,0,0)
f(25,178,5,2,'scala/collection/mutable/ArrayBuffer.array',5,0,0)
f(24,183,1,2,'scala/collection/mutable/PriorityQueue.ord',1,0,0)
f(24,184,3,2,'scala/collection/mutable/PriorityQueue.scala$collection$mutable$PriorityQueue$$resarr',3,0,0)
f(12,187,2,3,'vtable stub')
f(11,189,8,2,'kyo/core$.kyo$core$$$_$transformLoop$1',4,0,0)
f(12,191,2,3,'itable stub')
f(12,193,4,1,'kyo/bench/ForkManyBench$$Lambda$62.0x0000000800d40ac0.apply')
f(13,196,1,2,'kyo/bench/ForkManyBench.repeat$2$$anonfun$1',1,0,0)
f(14,196,1,2,'kyo/bench/ForkManyBench.repeat$2',1,0,0)
f(15,196,1,2,'kyo/package$KyoOps$.flatMap$extension',1,0,0)
f(16,196,1,2,'kyo/core$.transform',1,0,0)
f(17,196,1,2,'kyo/core$.kyo$core$$$_$transformLoop$1',1,0,0)
f(10,197,6,2,'kyo/core$.kyo$core$$$_$transformLoop$1',4,0,0)
f(11,201,2,1,'kyo/bench/ForkManyBench$$Lambda$60.0x0000000800d41bd8.apply')
f(10,203,1,3,'vtable stub')
f(9,204,1,1,'kyo/ios$KyoIO.effect')
f(9,205,4,3,'vtable stub')
f(7,209,83,1,'kyo/concurrent/scheduler/Queue.poll',2,0,0)
f(8,210,2,1,'java/lang/invoke/Invokers$Holder.linkToTargetMethod')
f(9,211,1,1,'java/lang/invoke/DirectMethodHandle$Holder.newInvokeSpecial')
f(10,211,1,1,'kyo/concurrent/scheduler/Queue$$Lambda$56.0x0000000800d46778.<init>')
f(8,212,80,0,'kyo/concurrent/scheduler/Queue.modify',1,0,66)
f(9,278,3,4,'InterpreterRuntime::frequency_counter_overflow(JavaThread*, unsigned char*)')
f(10,278,3,4,'InterpreterRuntime::frequency_counter_overflow_inner(JavaThread*, unsigned char*)')
f(11,278,3,4,'CompilationPolicy::event(methodHandle const&, methodHandle const&, int, int, CompLevel, CompiledMethod*, JavaThread*)')
f(12,278,1,4,'CompilationPolicy::call_event(methodHandle const&, CompLevel, Thread*)')
f(13,278,1,4,'CompLevel CompilationPolicy::common<LoopPredicate>(methodHandle const&, CompLevel, bool)')
f(14,278,1,4,'CompilerConfig::is_interpreter_only()')
f(12,279,2,4,'CompilationPolicy::compile(methodHandle const&, int, CompLevel, JavaThread*)')
f(13,279,1,4,'CompileBroker::compile_method(methodHandle const&, int, int, methodHandle const&, int, CompileTask::CompileReason, JavaThread*)')
f(14,279,1,4,'DirectiveSet::compilecommand_compatibility_init(methodHandle const&) [clone .part.0]')
f(15,279,1,4,'bool CompilerOracle::has_option_value<bool>(methodHandle const&, CompileCommand, bool&)')
f(13,280,1,3,'clock_gettime')
f(9,281,3,2,'java/util/concurrent/atomic/AtomicBoolean.compareAndSet',3,0,0)
f(10,281,3,2,'java/lang/invoke/VarHandleGuards.guard_LII_Z',3,0,0)
f(11,281,3,2,'java/lang/invoke/VarHandle.checkExactAccessMode',3,0,0)
f(9,284,1,1,'java/util/concurrent/atomic/AtomicBoolean.set')
f(9,285,7,1,'kyo/concurrent/scheduler/Queue$$Lambda$56.0x0000000800d46778.apply')
f(10,285,7,2,'kyo/concurrent/scheduler/Queue.poll$$anonfun$1',7,0,0)
f(11,285,7,2,'scala/collection/mutable/PriorityQueue.dequeue',7,0,0)
f(12,285,7,2,'scala/collection/mutable/PriorityQueue.fixDown',7,0,0)
f(13,287,4,2,'kyo/concurrent/scheduler/IOTask$TaskOrdering$.gteq',4,0,0)
f(14,287,4,2,'scala/math/Ordering.gteq$',4,0,0)
f(15,287,4,2,'scala/math/Ordering.gteq',4,0,0)
f(16,287,4,2,'kyo/concurrent/scheduler/IOTask$TaskOrdering$.compare',4,0,0)
f(13,291,1,2,'kyo/concurrent/scheduler/IOTask$TaskOrdering$.lt',1,0,0)
f(7,292,1,1,'kyo/concurrent/scheduler/Worker.flush')
f(8,292,1,1,'kyo/concurrent/scheduler/Queue.drain')
f(9,292,1,1,'kyo/concurrent/scheduler/Queue.modify')
f(10,292,1,1,'kyo/concurrent/scheduler/Queue$$Lambda$75.0x0000000800d4b298.apply')
f(11,292,1,1,'kyo/concurrent/scheduler/Queue.drain$$anonfun$adapted$1')
f(12,292,1,1,'kyo/concurrent/scheduler/Queue.drain$$anonfun$1')
f(13,292,1,1,'scala/collection/AbstractIterable.foreach')
f(14,292,1,1,'scala/collection/IterableOnceOps.foreach$')
f(15,292,1,1,'scala/collection/IterableOnceOps.foreach')
f(16,292,1,1,'scala/runtime/function/JProcedure1.apply')
f(17,292,1,1,'scala/runtime/function/JProcedure1.apply')
f(18,292,1,1,'kyo/concurrent/scheduler/Worker$$Lambda$74.0x0000000800d4ae98.applyVoid')
f(19,292,1,1,'kyo/concurrent/scheduler/Worker.flush$$anonfun$1')
f(20,292,1,1,'kyo/concurrent/scheduler/Scheduler$.submit')
f(21,292,1,1,'kyo/concurrent/scheduler/Worker.enqueue')
f(22,292,1,1,'java/util/concurrent/locks/LockSupport.unpark')
f(23,292,1,1,'jdk/internal/misc/Unsafe.unpark')
f(24,292,1,3,'pthread_cond_signal')
f(25,292,1,5,'entry_SYSCALL_64_after_hwframe')
f(26,292,1,5,'do_syscall_64')
f(27,292,1,5,'__x64_sys_futex')
f(28,292,1,5,'do_futex')
f(29,292,1,5,'futex_wake')
f(7,293,2,2,'kyo/concurrent/scheduler/Worker.stop$1',2,0,0)
f(8,294,1,2,'kyo/concurrent/scheduler/Scheduler$.stopWorker',1,0,0)

search();
</script></body></html>