Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Плясов Климентий, ИТМО DWS, stage 6 #228

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
caa3b3b
1
Handiesto Feb 21, 2024
3af5bd4
cc1
Handiesto Feb 21, 2024
daef6f8
cc2
Handiesto Feb 21, 2024
c0481f0
cc3
Handiesto Feb 21, 2024
36d6d2a
cc4
Handiesto Feb 21, 2024
1cda826
reports
Handiesto Feb 21, 2024
42a949a
reports_fix
Handiesto Feb 21, 2024
9653834
Merge branch 'main' into main
incubos Feb 25, 2024
25ff852
Merge branch 'main' into main
incubos Feb 27, 2024
9b5fe6b
hw2
Handiesto Feb 29, 2024
810edff
hw2_2
Handiesto Feb 29, 2024
beeb6c9
сс
Handiesto Feb 29, 2024
e4db067
Merge remote-tracking branch 'upstream/main' into hw2
Handiesto Feb 29, 2024
abbe08d
report2
Handiesto Mar 6, 2024
bcdf9fb
Merge branch 'main' into hw2
atimofeyev Mar 10, 2024
5f7f9b0
Merge remote-tracking branch 'upstream/main' into hw2
Handiesto Apr 11, 2024
60e8135
hw5
Handiesto Apr 11, 2024
c4f5480
Merge remote-tracking branch 'origin/hw2' into hw2
Handiesto Apr 11, 2024
517208e
hw5_сс
Handiesto Apr 11, 2024
451452c
hw5_сс1
Handiesto Apr 11, 2024
df94762
hw5_сс1
Handiesto Apr 11, 2024
ef914b3
hw5_сс34
Handiesto Apr 11, 2024
5568cf8
hw5_сс35
Handiesto Apr 11, 2024
292deb2
Merge branch 'main' into hw2
incubos Apr 13, 2024
644ca83
report
Handiesto Apr 17, 2024
45db18d
Merge remote-tracking branch 'origin/hw2' into hw2
Handiesto Apr 17, 2024
20a777e
Merge remote-tracking branch 'upstream/main' into hw2
Handiesto Apr 25, 2024
e4f4c07
hw6
Handiesto Apr 25, 2024
741bab9
hw6.1
Handiesto Apr 25, 2024
231b1df
hw6.2
Handiesto Apr 25, 2024
60e7694
hw6.3
Handiesto Apr 25, 2024
ab49f24
hw6.4
Handiesto Apr 25, 2024
990fc13
hw6.5
Handiesto Apr 25, 2024
8e0f8ed
hw6.5
Handiesto Apr 25, 2024
f2a3422
hw6.6
Handiesto Apr 25, 2024
dd7b3ed
hw6.7
Handiesto Apr 25, 2024
0d26b79
Merge branch 'main' into hw6
incubos Apr 28, 2024
b9bd484
a
Handiesto May 1, 2024
fd02d9a
Merge remote-tracking branch 'origin/hw6' into hw6
Handiesto May 1, 2024
49f106d
Merge branch 'main' into hw6
incubos May 1, 2024
84cd1c2
Merge remote-tracking branch 'upstream/main' into hw6
Handiesto May 1, 2024
8956609
dop_Rep
Handiesto May 1, 2024
8ff70c9
Merge remote-tracking branch 'origin/hw6' into hw6
Handiesto May 1, 2024
aecc716
Merge branch 'main' into hw6
incubos May 11, 2024
a26d9ec
Merge branch 'main' into hw6
incubos May 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
Ω<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<style>
body {margin: 0; padding: 10px 10px 22px 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 {position: fixed; bottom: 0; margin: 0; padding: 2px 3px 2px 3px; outline: 1px solid #ffc000; display: none; overflow: hidden; white-space: nowrap; background-color: #ffffe0}
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 {left: 0}
#match {right: 0}
#reset {cursor: pointer}
#canvas {width: 100%; height: 288px}
</style>
</head>
<body style='font: 12px Verdana, sans-serif'>
<h1>Allocation 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/async-profiler/async-profiler'>async-profiler</a></header>
<canvas id='canvas'></canvas>
<div id='hl'><span></span></div>
<p id='status'></p>
<p id='match'>Matched: <span id='matchval'></span> <span id='reset' title='Clear'>&#x274c;</span></p>
<script>
// Copyright The async-profiler authors
// SPDX-License-Identifier: Apache-2.0
'use strict';
let root, rootLevel, px, pattern;
let level0 = 0, left0 = 0, width0 = 0;
let reverse = false;
const levels = Array(18);
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(key, level, left, width, inln, c1, int) {
levels[level0 = level].push({left: left0 += left, width: width0 = width || width0,
color: getColor(palette[key & 7]), title: cpool[key >>> 3],
details: (int ? ', int=' + int : '') + (c1 ? ', c1=' + c1 : '') + (inln ? ', inln=' + inln : '')
});
}

function u(key, width, inln, c1, int) {
f(key, level0 + 1, 0, width, inln, c1, int)
}

function n(key, width, inln, c1, int) {
f(key, level0, width0, width, inln, c1, int)
}

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 ? 'inline-block' : '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();
}

function unpack(cpool) {
for (let i = 1; i < cpool.length; i++) {
cpool[i] = cpool[i - 1].substring(0, cpool[i].charCodeAt(0) - 32) + cpool[i].substring(1);
}
}

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;
status.style.display = 'inline-block';
return;
}
}
canvas.onmouseout();
}

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

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);
}
}

const cpool = [
'all',
' byte[]',
' java.nio.HeapByteBuffer',
'$/lang/Class.getSimpleName',
'*Integer.formatUnsignedInt',
'2toHexString',
'4UnsignedString0',
'*Thread.run',
'4With',
'*foreign/MemorySegment.copy',
'%nio/channels/spi/AbstractSelectableChannel.register',
'%util/concurrent/ThreadPoolExecutor$Worker.run',
'G.runWorker',
'!dk.internal.foreign.MappedMemorySegmentImpl',
'#/internal/foreign/AbstractMemorySegmentImpl.copy',
'OtoArray',
'-misc/ScopedMemoryAccess.copyMemory',
'OInternal',
'2Unsafe.copyMemory',
' one.nio.net.Session$ArrayQueueItem',
'#/nio/net/JavaSelector.registerPendingSessions',
'9select',
',Session.write',
'(server/PayloadThread.run',
'/SelectorThread.run',
' ru.vk.itmo.test.klimplyasov.dao.ReferenceBaseEntry',
'"/vk/itmo/test/klimplyasov/ChunkGenerator.writeDataChunk',
'PResponseHeaders',
'<PlyasovServer$$Lambda.0x000000030118d2c8.run',
'I.lambda$handleLocalEntitiesRangeRequest$6',
'JwriteDataChunks',
'<dao/LiveFilteringIterator.next',
'VskipTombstones',
'@MergingEntryIterator.next',
'@SSTable$SliceIterator.next',
'@WeightedPeekingEntryIterator.next',
' sun.nio.ch.SelectionKeyImpl',
'#/nio/ch/SelectorImpl.register'
];
unpack(cpool);

n(3,8385)
u(185,8383)
u(57)
u(65)
u(89)
u(97)
u(225)
u(233)
u(217,3)
u(177)
u(177)
u(154)
f(241,8,3,8380)
u(209,6024)
u(41,360)
u(49)
u(33)
u(10)
f(121,10,360,1991)
u(121)
u(25,1612)
u(10)
f(73,12,1612,379)
u(113)
u(129)
u(137)
u(145)
u(10)
f(177,10,379,3673)
u(177)
u(18)
f(249,9,3673,2356)
u(249)
u(257)
u(265)
u(265)
u(281)
u(273)
u(273)
u(106,1691)
n(202,665)
f(193,1,665,2)
u(169)
u(161)
u(81)
u(297)
u(290)

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