Add blackbox tests for processing profiler logs.
This commit is contained in:
Родитель
206cc9287d
Коммит
0cc341cd97
|
@ -5,4 +5,7 @@ module.exports = {
|
|||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"moduleNameMapper": {
|
||||
'tickprocessor': '../../lib/tickprocessor'
|
||||
},
|
||||
}
|
|
@ -28,9 +28,11 @@
|
|||
"@types/concat-stream": "^1.6.0",
|
||||
"@types/jest": "^24.0.17",
|
||||
"@types/puppeteer": "^1.12.4",
|
||||
"@types/tmp": "^0.1.0",
|
||||
"@types/yargs-parser": "^13.0.0",
|
||||
"jest": "^24.8.0",
|
||||
"just-scripts": "0.28.0",
|
||||
"tmp": "^0.1.0",
|
||||
"ts-jest": "^24.0.2",
|
||||
"typescript": "^3.5.1"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as tmp from 'tmp';
|
||||
|
||||
import { generateFlamegraph } from '../flamegraph/generate';
|
||||
|
||||
const profiles = require('../fixtures/profiles.json');
|
||||
const snapshotsDir = path.join(__dirname, '../fixtures/snapshots');
|
||||
|
||||
// TODO: these are black box tests for now but should be refactored to be unit tests
|
||||
// TODO: modules that output files should be modified not to and wrapped by a centralized file output helper
|
||||
// TODO: consider also making file output / github / CI integration another package within this repo
|
||||
|
||||
describe('process', () => {
|
||||
it('generates expected output', async () => {
|
||||
jest.setTimeout(30000);
|
||||
|
||||
expect.assertions(84);
|
||||
|
||||
const outdir = tmp.dirSync({ unsafeCleanup: true });
|
||||
|
||||
await Promise.all(Object.keys(profiles).map(key => {
|
||||
let logfile = require.resolve(path.join('../fixtures', profiles[key].logFile));
|
||||
let outfile = path.join(outdir.name, key);
|
||||
return generateFlamegraph(logfile, outfile)
|
||||
}));
|
||||
|
||||
await Promise.all(Object.keys(profiles).map(key => {
|
||||
let logfile = require.resolve(path.join('../fixtures', profiles[key].reference.logFile));
|
||||
let outfile = path.join(outdir.name, key + '_ref');
|
||||
return generateFlamegraph(logfile, outfile)
|
||||
}));
|
||||
|
||||
const snapshotFiles = fs.readdirSync(snapshotsDir);
|
||||
const testFiles = fs.readdirSync(outdir.name);
|
||||
|
||||
// TODO: re-enable once regression output is generated
|
||||
// expect(snapshotFiles).toEqual(testFiles);
|
||||
|
||||
testFiles.forEach(file => {
|
||||
// Generated output uses just \n. Code committed in github also uses just \n.
|
||||
// However, Windows clients can be configured to translate to \r\n while working,
|
||||
// so we must ignore line break types when comparing results.
|
||||
const analysis = fs.readFileSync(path.join(snapshotsDir, file), 'utf8').split(/\r?\n/g);
|
||||
const output = fs.readFileSync(path.join(outdir.name, file), 'utf8').split(/\r?\n/g);
|
||||
|
||||
expect(analysis).toEqual(output);
|
||||
});
|
||||
|
||||
outdir.removeCallback();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { checkForRegressions, FunctionData, __unitTestHooks } from '../processData';
|
||||
import { FunctionData, __unitTestHooks } from '../processData';
|
||||
|
||||
const { filterMinifiedNames, filterSystemNames } = __unitTestHooks;
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# CR -> CRLF conversion will break tickprocessor, so prevent profiles from having their line endings changed.
|
||||
# Also prevent CRLF conversion on snapshot files for easier comparison.
|
||||
* -text
|
|
@ -0,0 +1,170 @@
|
|||
{
|
||||
"BaseButton": {
|
||||
"logFile": "profiles/isolate-000001C8E897A980-9332-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\BaseButton",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000002716F92D960-27048-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\BaseButton_ref"
|
||||
}
|
||||
},
|
||||
"BaseButtonNew": {
|
||||
"logFile": "profiles/isolate-00000150C15DDCB0-8200-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\BaseButtonNew",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001C7CB0729F0-15316-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\BaseButtonNew_ref"
|
||||
}
|
||||
},
|
||||
"button": {
|
||||
"logFile": "profiles/isolate-000001FA30C2C060-15348-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\button",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-00000218B8DE6280-33408-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\button_ref"
|
||||
}
|
||||
},
|
||||
"DefaultButton": {
|
||||
"logFile": "profiles/isolate-0000026F3D5C86F0-32220-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DefaultButton",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001A279165800-31988-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DefaultButton_ref"
|
||||
}
|
||||
},
|
||||
"DefaultButtonNew": {
|
||||
"logFile": "profiles/isolate-000001976475B760-12772-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DefaultButtonNew",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001AFA4995FB0-8920-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DefaultButtonNew_ref"
|
||||
}
|
||||
},
|
||||
"DetailsRow": {
|
||||
"logFile": "profiles/isolate-000001C75B30DD10-19448-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DetailsRow",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-0000016A4F24EAD0-27036-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DetailsRow_ref"
|
||||
}
|
||||
},
|
||||
"DetailsRowFast": {
|
||||
"logFile": "profiles/isolate-000001AB3AA2DE10-28068-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DetailsRowFast",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-0000025EBEA9C020-13384-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DetailsRowFast_ref"
|
||||
}
|
||||
},
|
||||
"DetailsRowNoStyles": {
|
||||
"logFile": "profiles/isolate-000001D1BFE31800-24432-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DetailsRowNoStyles",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001CEF69AFE10-4612-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DetailsRowNoStyles_ref"
|
||||
}
|
||||
},
|
||||
"DocumentCardTitle": {
|
||||
"logFile": "profiles/isolate-000001658015DEE0-9140-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DocumentCardTitle",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000002A0A0FDD770-30228-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\DocumentCardTitle_ref"
|
||||
}
|
||||
},
|
||||
"MenuButton": {
|
||||
"logFile": "profiles/isolate-0000023E414D6CE0-28460-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\MenuButton",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000002744B17D570-32064-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\MenuButton_ref"
|
||||
}
|
||||
},
|
||||
"MenuButtonNew": {
|
||||
"logFile": "profiles/isolate-0000021FD7B39BB0-28188-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\MenuButtonNew",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-0000028C417C8AC0-24936-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\MenuButtonNew_ref"
|
||||
}
|
||||
},
|
||||
"PrimaryButton": {
|
||||
"logFile": "profiles/isolate-00000224DD39CC70-27088-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\PrimaryButton",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-00000289B99F90F0-33752-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\PrimaryButton_ref"
|
||||
}
|
||||
},
|
||||
"PrimaryButtonNew": {
|
||||
"logFile": "profiles/isolate-000001D40015E310-20784-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\PrimaryButtonNew",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001C3BAC2EA80-32776-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\PrimaryButtonNew_ref"
|
||||
}
|
||||
},
|
||||
"SplitButton": {
|
||||
"logFile": "profiles/isolate-000001D2DD15DB40-22696-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\SplitButton",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001292C499B50-24060-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\SplitButton_ref"
|
||||
}
|
||||
},
|
||||
"SplitButtonNew": {
|
||||
"logFile": "profiles/isolate-0000027E6DE24B80-31272-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\SplitButtonNew",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000002EAD2E39E10-33780-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\SplitButtonNew_ref"
|
||||
}
|
||||
},
|
||||
"Stack": {
|
||||
"logFile": "profiles/isolate-000002958EF69420-30340-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\Stack",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-00000199612E7F60-32084-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\Stack_ref"
|
||||
}
|
||||
},
|
||||
"StackWithIntrinsicChildren": {
|
||||
"logFile": "profiles/isolate-000002CB95DF62A0-29024-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\StackWithIntrinsicChildren",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001F8F52C6E60-30996-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\StackWithIntrinsicChildren_ref"
|
||||
}
|
||||
},
|
||||
"StackWithTextChildren": {
|
||||
"logFile": "profiles/isolate-000001E2F953C450-33588-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\StackWithTextChildren",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001AA84CA8D20-8016-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\StackWithTextChildren_ref"
|
||||
}
|
||||
},
|
||||
"Text": {
|
||||
"logFile": "profiles/isolate-00000257772F8820-33584-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\Text",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000002236CE1DD30-25244-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\Text_ref"
|
||||
}
|
||||
},
|
||||
"Toggle": {
|
||||
"logFile": "profiles/isolate-00000248C0C3E090-14868-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\Toggle",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-000001FCF48C0980-25140-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\Toggle_ref"
|
||||
}
|
||||
},
|
||||
"ToggleNew": {
|
||||
"logFile": "profiles/isolate-000002231747AC50-11576-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\ToggleNew",
|
||||
"reference": {
|
||||
"logFile": "profiles/isolate-0000014BEA16EDB0-28552-puppeteer.prof",
|
||||
"outFile": "C:\\git\\oufr-jg\\apps\\perf-test\\dist\\ToggleNew_ref"
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,4 @@
|
|||
names = ["(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:12:23","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:12:222","~fc file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:19:61","(lib) C:\\git\\oufr-jg\\node_modules\\puppeteer\\.local-chromium\\win64-672088\\chrome-win\\chrome_child.dll","(unknown)","~injectEventPluginsByName file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:165:487","~Ee file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:14:90","~Fe file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:15:12","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:10","~r file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:33","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3483322","~(anonymous) :1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:923","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2057389","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3491678","~(anonymous) :105:185","~(anonymous) :105:208","(lib) C:\\WINDOWS\\SYSTEM32\\ntdll.dll","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3088650","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:46613","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:155026","~(anonymous) :1:37","~initializeThemeState :44:30","~_defineGetter :1489:23","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3611635","~(anonymous) :4:36","~webpackContext :26:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3613606","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:201883","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3275542","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2741994","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1890615","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3374257","~(anonymous) :11674:64","~styled :33:16","~(anonymous) :37:43","~r.d file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:181","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3614036","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2161985","~mergeStyles :11:21","~styleToClassName :445:26","~styleToRegistration :401:29","~getKeyForRules :362:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3617592","~(anonymous) :6:49","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3625553","~lib_initializeIcons :2289:29","~(anonymous) :2291:624","~fabric_icons_10_initializeIcons :1331:41","~registerIconAliases :2247:36","~registerIconAlias :152:27","~render :266:336","~Si :264:12","~Hi :251:12","~(anonymous) :264:339","~Pi.render :261:29","~Ki :253:42","~Ji :252:12","~qf :243:12","~Xh :245:83","~Yh :248:12","~Di :249:12","~ci :233:12","~bi :232:12","~Tg :177:12","~S :164:45","~(anonymous) :145:114","~v :142:337","~p :140:224","~Ye :122:12","~K :118:419","~Ue :118:12","~Og :167:12","~Qg :173:12","~obj.<computed> :264:36","~BaseButton.render :387:44","~assign :50:16","~filteredAssign :70:24","~ai :222:12","~tc :55:12","~Lf :148:288","~he :101:184","~ge :101:12","~vf :132:12","~BaseButton :102:24","~createRef :21:372","~memoizedFunction :73:37","~BaseButton._onRenderContent :496:54","~Button :505:31","~M :15:11","~qe :107:12","~getId :98:15","~se :109:12","~Id :87:12","~xf :134:12","~BaseComponent._warnConditionallyRequiredProps :230:72","~get :116:23","~getNativeProps :393:24","~(anonymous) :398:92","~lh :194:140","~ke :103:12","~we :110:12","~qc :49:12","~pc :48:127","~Eg :163:273","~_normalizeArg :100:23","~BaseButton._this._onRenderTextContents :127:48","~BaseButton._this._onRenderText :136:40","~re :108:12","~Af :136:12","~oc :48:12","~J :114:349","~BaseComponent :70:27","~xe :110:125","~_makeAllSafe :252:22","~_makeSafe :257:19","~Ig :185:375","~f :138:420","~BaseComponent._warnDeprecations :212:58","~Ng :166:128","~Fi :250:12","~exports.unstable_runWithPriority :18:42","~(anonymous) :250:265","~Zh :219:12","~Th :214:12","~Vh :216:12"];
|
||||
levels = [[0,1,0,0,326,6],[0,1,1,0,1,1,0,325,10],[0,1,2,0,1,2,0,325,11],[0,1,3,0,1,3,0,325,12],[0,1,4,0,1,7,0,325,13],[0,1,5,0,1,8,0,325,14],[1,1,9,0,14,12,0,2,49,0,309,54],[1,1,5,0,1,15,0,1,16,0,2,21,0,10,27,0,1,5,0,1,52,0,309,55],[1,1,5,0,1,14,0,1,14,0,2,14,0,10,14,0,1,50,0,1,53,0,309,56],[2,1,12,0,1,12,0,2,12,0,10,5,0,1,51,0,1,5,0,309,57],[2,1,5,0,1,17,0,2,22,0,10,28,0,1,5,0,1,5,0,309,58],[3,1,14,0,2,14,0,10,29,0,1,5,1,309,59],[3,1,5,0,1,12,0,1,26,0,10,12,2,309,60],[3,1,18,0,1,23,0,1,5,0,6,30,0,2,40,0,1,46,0,1,48,2,309,61],[3,1,5,0,1,14,0,1,5,0,6,14,0,2,14,0,1,14,0,1,14,2,309,62],[3,1,19,0,1,24,1,6,12,0,2,12,0,1,5,0,1,5,2,309,63],[3,1,5,0,1,25,1,6,31,0,2,41,0,1,47,0,1,5,2,309,64],[3,1,20,0,1,5,1,6,14,0,1,5,0,1,14,0,1,5,3,1,5,0,305,65,0,3,123],[4,1,20,1,1,5,0,2,12,0,1,36,0,1,37,0,1,39,0,1,5,0,1,42,0,1,5,3,1,5,0,1,5,0,304,66,0,3,124],[6,1,5,0,1,32,0,1,34,0,1,5,0,1,38,0,1,5,1,1,43,6,18,5,0,172,67,0,114,81,0,3,125],[7,1,14,0,1,14,0,1,5,0,1,5,0,1,5,1,1,44,23,1,5,0,3,5,0,16,68,0,144,75,0,6,83,0,2,116,0,1,122,0,54,5,0,11,6,0,18,82,0,3,93,0,9,95,0,7,102,0,5,103,0,2,104,0,1,107,0,4,111,0,3,126],[7,1,12,0,1,12,4,1,45,27,16,69,0,87,76,0,53,86,0,3,97,0,1,119,0,3,5,0,3,84,0,2,5,0,1,5,52,2,5,0,11,5,0,14,5,0,3,105,0,1,113,0,3,5,0,5,5,0,4,96,0,7,5,0,1,5,0,4,6,0,2,5,0,1,5,0,4,5,0,1,127,0,2,128],[7,1,33,0,1,35,4,1,5,27,1,5,0,12,70,0,3,72,0,3,5,0,7,68,0,77,77,0,5,5,0,47,87,0,1,114,0,2,5,0,1,114,0,1,5,3,1,5,0,2,85,80,2,5,0,3,106,0,1,5,8,4,5,5,2,5,1,4,5,4,3,5,0,1,5,0,2,5],[7,1,14,0,1,5,4,1,5,28,3,5,0,8,71,0,1,120,0,1,5,0,2,73,3,7,69,0,77,78,5,19,5,0,2,88,0,6,94,0,8,98,0,11,115,0,1,121,0,1,5,2,1,5,5,2,5,82,3,5,29,3,5],[7,1,12,0,1,5,36,2,5,0,5,72,0,1,112,0,1,5,1,2,74,3,3,5,0,3,72,0,1,112,0,12,5,0,17,79,0,10,89,0,29,90,0,9,100,13,11,5,0,2,5,0,6,5,0,3,5,0,5,99,0,3,5,0,8,117,0,1,5],[7,1,5,39,1,5,0,4,73,0,1,5,2,2,5,6,1,5,0,2,73,0,1,5,12,5,5,0,12,80,0,9,5,0,1,108,0,4,5,0,25,91,0,2,5,0,7,80,24,2,5,4,2,5,3,5,5,3,2,5,0,6,118],[7,1,5,40,1,5,0,3,74,12,2,74,16,2,5,0,12,5,9,1,5,4,7,5,0,10,92,0,8,109,2,2,5,0,5,101,35,5,5,5,6,5],[49,3,5,12,2,5,49,2,5,0,10,5,0,2,5,0,1,92,0,5,110,4,5,5,36,4,5,8,3,5],[129,1,5,0,1,5,0,4,92,6,3,5],[131,4,5]];
|
||||
numTicks = 327;
|
||||
module.exports = { names, levels, numTicks };
|
|
@ -0,0 +1,439 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>flamebearer</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font: 16px 'Helvetica Neue', sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body.hover {
|
||||
background: #cfc;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 30px;
|
||||
margin: 30px 30px 15px;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#fire-icon {
|
||||
fill: #f53;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
vertical-align: -1px;
|
||||
}
|
||||
|
||||
#intro {
|
||||
margin: 0 30px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 13px;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
code span {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#controls {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#search {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#highlight {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
background: #ffffff40;
|
||||
}
|
||||
|
||||
.loaded #intro {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.loaded #header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
padding: 7px 10px;
|
||||
}
|
||||
|
||||
.loaded h1 {
|
||||
font-size: 22px;
|
||||
margin: 0 auto 0 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.loaded #fire-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.loaded #controls {
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#tooltip {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
background: #ffffff;
|
||||
white-space: nowrap;
|
||||
box-shadow: 1px 2px 4px 0px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 2px;
|
||||
padding: 3px 5px;
|
||||
font: 12px Tahoma, sans-serif;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tooltip .path {
|
||||
color: #888;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#tooltip .time {
|
||||
color: #4a4;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1>
|
||||
<svg
|
||||
id="fire-icon"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 15 15"
|
||||
style="enable-background:new 0 0 15 15;"
|
||||
xml:space="preserve"
|
||||
>
|
||||
<path
|
||||
d="M7.5,0.5L5,4.5l-1.5-2 C2.9452,3.4753,0.8036,5.7924,0.8036,8.3036C0.8036,12.002,3.8017,15,7.5,15s6.6964-2.998,6.6964-6.6964 c0-2.5112-2.1416-4.8283-2.6964-5.8036l-1.5,2L7.5,0.5z M7.5,7c0,0,2.5,2.5618,2.5,4.5c0,0.8371-0.8259,2-2.5,2S5,12.3371,5,11.5 C5,9.6283,7.5,7,7.5,7z"
|
||||
/>
|
||||
</svg>
|
||||
<a href="https://github.com/mapbox/flamebearer">flamebearer</a>
|
||||
</h1>
|
||||
<div id="controls">
|
||||
<input id="search" placeholder="Search..." />
|
||||
<button id="reset">Reset view</button><br />
|
||||
<input id="framework" type="checkbox" /><label for="framework">Include Framework</label><br />
|
||||
<input id="system" type="checkbox" /><label for="system">Include System</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="highlight"></div>
|
||||
<div id="tooltip"></div>
|
||||
<div id="intro">
|
||||
<!-- -->
|
||||
</div>
|
||||
<canvas id="canvas" height="0"></canvas>
|
||||
|
||||
<!-- -->
|
||||
<script>const frameworkName = /~([a-zA-Z]{1,2}|[a-zA-Z]{1}\.[a-zA-Z]{1})[\. ]|~render |~\(anonymous\)|\(unknown\)|\~webpack/;
|
||||
const systemName = /\(C\+\+\)|\(lib\)/;
|
||||
|
||||
function isFrameworkName(name) {
|
||||
return frameworkName.test(name);
|
||||
}
|
||||
|
||||
function isSystemName(name) {
|
||||
return systemName.test(name);
|
||||
}
|
||||
|
||||
|
||||
'use strict';
|
||||
|
||||
const introEl = document.getElementById('intro');
|
||||
const searchEl = document.getElementById('search');
|
||||
const highlightEl = document.getElementById('highlight');
|
||||
const tooltipEl = document.getElementById('tooltip');
|
||||
const frameworkEl = document.getElementById('framework');
|
||||
const systemEl = document.getElementById('system');
|
||||
const canvas = document.getElementById('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
let names, levels, numTicks;
|
||||
|
||||
names = ["(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:12:23","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:12:222","~fc file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:19:61","(lib) C:\\git\\oufr-jg\\node_modules\\puppeteer\\.local-chromium\\win64-672088\\chrome-win\\chrome_child.dll","(unknown)","~injectEventPluginsByName file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:165:487","~Ee file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:14:90","~Fe file:///C:/git/oufr-jg/apps/perf-test/dist/react-dom.production.min.js:15:12","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:10","~r file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:33","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3483322","~(anonymous) :1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:923","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2057389","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3491678","~(anonymous) :105:185","~(anonymous) :105:208","(lib) C:\\WINDOWS\\SYSTEM32\\ntdll.dll","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3088650","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:46613","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:155026","~(anonymous) :1:37","~initializeThemeState :44:30","~_defineGetter :1489:23","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3611635","~(anonymous) :4:36","~webpackContext :26:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3613606","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:201883","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3275542","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2741994","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1890615","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3374257","~(anonymous) :11674:64","~styled :33:16","~(anonymous) :37:43","~r.d file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:181","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3614036","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2161985","~mergeStyles :11:21","~styleToClassName :445:26","~styleToRegistration :401:29","~getKeyForRules :362:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3617592","~(anonymous) :6:49","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3625553","~lib_initializeIcons :2289:29","~(anonymous) :2291:624","~fabric_icons_10_initializeIcons :1331:41","~registerIconAliases :2247:36","~registerIconAlias :152:27","~render :266:336","~Si :264:12","~Hi :251:12","~(anonymous) :264:339","~Pi.render :261:29","~Ki :253:42","~Ji :252:12","~qf :243:12","~Xh :245:83","~Yh :248:12","~Di :249:12","~ci :233:12","~bi :232:12","~Tg :177:12","~S :164:45","~(anonymous) :145:114","~v :142:337","~p :140:224","~Ye :122:12","~K :118:419","~Ue :118:12","~Og :167:12","~Qg :173:12","~obj.<computed> :264:36","~BaseButton.render :387:44","~assign :50:16","~filteredAssign :70:24","~ai :222:12","~tc :55:12","~Lf :148:288","~he :101:184","~ge :101:12","~vf :132:12","~BaseButton :102:24","~createRef :21:372","~memoizedFunction :73:37","~BaseButton._onRenderContent :496:54","~Button :505:31","~M :15:11","~qe :107:12","~getId :98:15","~se :109:12","~Id :87:12","~xf :134:12","~BaseComponent._warnConditionallyRequiredProps :230:72","~get :116:23","~getNativeProps :393:24","~(anonymous) :398:92","~lh :194:140","~ke :103:12","~we :110:12","~qc :49:12","~pc :48:127","~Eg :163:273","~_normalizeArg :100:23","~BaseButton._this._onRenderTextContents :127:48","~BaseButton._this._onRenderText :136:40","~re :108:12","~Af :136:12","~oc :48:12","~J :114:349","~BaseComponent :70:27","~xe :110:125","~_makeAllSafe :252:22","~_makeSafe :257:19","~Ig :185:375","~f :138:420","~BaseComponent._warnDeprecations :212:58","~Ng :166:128","~Fi :250:12","~exports.unstable_runWithPriority :18:42","~(anonymous) :250:265","~Zh :219:12","~Th :214:12","~Vh :216:12"];
|
||||
levels = [[0,1,0,0,326,6],[0,1,1,0,1,1,0,325,10],[0,1,2,0,1,2,0,325,11],[0,1,3,0,1,3,0,325,12],[0,1,4,0,1,7,0,325,13],[0,1,5,0,1,8,0,325,14],[1,1,9,0,14,12,0,2,49,0,309,54],[1,1,5,0,1,15,0,1,16,0,2,21,0,10,27,0,1,5,0,1,52,0,309,55],[1,1,5,0,1,14,0,1,14,0,2,14,0,10,14,0,1,50,0,1,53,0,309,56],[2,1,12,0,1,12,0,2,12,0,10,5,0,1,51,0,1,5,0,309,57],[2,1,5,0,1,17,0,2,22,0,10,28,0,1,5,0,1,5,0,309,58],[3,1,14,0,2,14,0,10,29,0,1,5,1,309,59],[3,1,5,0,1,12,0,1,26,0,10,12,2,309,60],[3,1,18,0,1,23,0,1,5,0,6,30,0,2,40,0,1,46,0,1,48,2,309,61],[3,1,5,0,1,14,0,1,5,0,6,14,0,2,14,0,1,14,0,1,14,2,309,62],[3,1,19,0,1,24,1,6,12,0,2,12,0,1,5,0,1,5,2,309,63],[3,1,5,0,1,25,1,6,31,0,2,41,0,1,47,0,1,5,2,309,64],[3,1,20,0,1,5,1,6,14,0,1,5,0,1,14,0,1,5,3,1,5,0,305,65,0,3,123],[4,1,20,1,1,5,0,2,12,0,1,36,0,1,37,0,1,39,0,1,5,0,1,42,0,1,5,3,1,5,0,1,5,0,304,66,0,3,124],[6,1,5,0,1,32,0,1,34,0,1,5,0,1,38,0,1,5,1,1,43,6,18,5,0,172,67,0,114,81,0,3,125],[7,1,14,0,1,14,0,1,5,0,1,5,0,1,5,1,1,44,23,1,5,0,3,5,0,16,68,0,144,75,0,6,83,0,2,116,0,1,122,0,54,5,0,11,6,0,18,82,0,3,93,0,9,95,0,7,102,0,5,103,0,2,104,0,1,107,0,4,111,0,3,126],[7,1,12,0,1,12,4,1,45,27,16,69,0,87,76,0,53,86,0,3,97,0,1,119,0,3,5,0,3,84,0,2,5,0,1,5,52,2,5,0,11,5,0,14,5,0,3,105,0,1,113,0,3,5,0,5,5,0,4,96,0,7,5,0,1,5,0,4,6,0,2,5,0,1,5,0,4,5,0,1,127,0,2,128],[7,1,33,0,1,35,4,1,5,27,1,5,0,12,70,0,3,72,0,3,5,0,7,68,0,77,77,0,5,5,0,47,87,0,1,114,0,2,5,0,1,114,0,1,5,3,1,5,0,2,85,80,2,5,0,3,106,0,1,5,8,4,5,5,2,5,1,4,5,4,3,5,0,1,5,0,2,5],[7,1,14,0,1,5,4,1,5,28,3,5,0,8,71,0,1,120,0,1,5,0,2,73,3,7,69,0,77,78,5,19,5,0,2,88,0,6,94,0,8,98,0,11,115,0,1,121,0,1,5,2,1,5,5,2,5,82,3,5,29,3,5],[7,1,12,0,1,5,36,2,5,0,5,72,0,1,112,0,1,5,1,2,74,3,3,5,0,3,72,0,1,112,0,12,5,0,17,79,0,10,89,0,29,90,0,9,100,13,11,5,0,2,5,0,6,5,0,3,5,0,5,99,0,3,5,0,8,117,0,1,5],[7,1,5,39,1,5,0,4,73,0,1,5,2,2,5,6,1,5,0,2,73,0,1,5,12,5,5,0,12,80,0,9,5,0,1,108,0,4,5,0,25,91,0,2,5,0,7,80,24,2,5,4,2,5,3,5,5,3,2,5,0,6,118],[7,1,5,40,1,5,0,3,74,12,2,74,16,2,5,0,12,5,9,1,5,4,7,5,0,10,92,0,8,109,2,2,5,0,5,101,35,5,5,5,6,5],[49,3,5,12,2,5,49,2,5,0,10,5,0,2,5,0,1,92,0,5,110,4,5,5,36,4,5,8,3,5],[129,1,5,0,1,5,0,4,92,6,3,5],[131,4,5]];
|
||||
numTicks = 327;
|
||||
|
||||
|
||||
let rangeMin = 0;
|
||||
let rangeMax = 1;
|
||||
let topLevel = 0;
|
||||
let query = '';
|
||||
let showFramework = false;
|
||||
let showSystem = false;
|
||||
let graphWidth, pxPerTick;
|
||||
|
||||
const pxPerLevel = 18;
|
||||
const collapseThreshold = 1;
|
||||
const hideThreshold = 0.5;
|
||||
const labelThreshold = 20;
|
||||
|
||||
let numTopLevelTicks = numTicks;
|
||||
|
||||
highlightEl.style.height = pxPerLevel + 'px';
|
||||
|
||||
if (levels) {
|
||||
init();
|
||||
}
|
||||
|
||||
function init() {
|
||||
document.body.classList.add('loaded');
|
||||
|
||||
// delta-decode bar positions
|
||||
for (const level of levels) {
|
||||
let prev = 0;
|
||||
for (let i = 0; i < level.length; i += 3) {
|
||||
level[i] += prev;
|
||||
prev = level[i] + level[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
updateFromHash();
|
||||
render();
|
||||
}
|
||||
|
||||
window.onhashchange = () => {
|
||||
updateFromHash();
|
||||
render();
|
||||
};
|
||||
canvas.onclick = e => {
|
||||
const { i, j } = xyToBar(e.offsetX, e.offsetY);
|
||||
if (j === -1) return;
|
||||
window.location.hash = [i, j].join(',');
|
||||
removeHover();
|
||||
};
|
||||
document.getElementById('reset').onclick = () => {
|
||||
searchEl.value = query = '';
|
||||
window.location.hash = '';
|
||||
render();
|
||||
};
|
||||
window.onresize = render;
|
||||
|
||||
searchEl.oninput = e => {
|
||||
query = e.target.value;
|
||||
render();
|
||||
};
|
||||
|
||||
frameworkEl.onchange = e => {
|
||||
showFramework = frameworkEl.checked;
|
||||
render();
|
||||
};
|
||||
|
||||
systemEl.onchange = e => {
|
||||
showSystem = systemEl.checked;
|
||||
render();
|
||||
};
|
||||
|
||||
function updateFromHash() {
|
||||
const [i, j] = window.location.hash
|
||||
.substr(1)
|
||||
.split(',')
|
||||
.map(Number);
|
||||
|
||||
if (!isNaN(i) && !isNaN(j)) {
|
||||
topLevel = i;
|
||||
numTopLevelTicks = levels[i][j + 1];
|
||||
rangeMin = levels[i][j] / numTicks;
|
||||
rangeMax = (levels[i][j] + levels[i][j + 1]) / numTicks;
|
||||
} else {
|
||||
topLevel = 0;
|
||||
numTopLevelTicks = numTicks;
|
||||
rangeMin = 0;
|
||||
rangeMax = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function tickToX(i) {
|
||||
return (i - numTicks * rangeMin) * pxPerTick;
|
||||
}
|
||||
|
||||
function render() {
|
||||
if (!levels) return;
|
||||
|
||||
graphWidth = canvas.width = canvas.clientWidth;
|
||||
canvas.height = pxPerLevel * (levels.length - topLevel);
|
||||
canvas.style.height = canvas.height + 'px';
|
||||
|
||||
if (devicePixelRatio > 1) {
|
||||
canvas.width *= 2;
|
||||
canvas.height *= 2;
|
||||
ctx.scale(2, 2);
|
||||
}
|
||||
|
||||
pxPerTick = graphWidth / numTicks / (rangeMax - rangeMin);
|
||||
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.font = '10px Tahoma, sans-serif';
|
||||
ctx.strokeStyle = 'white';
|
||||
|
||||
for (let i = 0; i < levels.length - topLevel; i++) {
|
||||
const level = levels[topLevel + i];
|
||||
|
||||
for (let j = 0; j < level.length; j += 3) {
|
||||
const barIndex = level[j];
|
||||
const x = tickToX(barIndex);
|
||||
const y = i * pxPerLevel;
|
||||
let numBarTicks = level[j + 1];
|
||||
|
||||
const inQuery = (query && names[level[j + 2]].indexOf(query) >= 0) || false;
|
||||
|
||||
// merge very small blocks into big "collapsed" ones for performance
|
||||
// const collapsed = numBarTicks * pxPerTick <= collapseThreshold;
|
||||
const collapsed = (!showFramework && isFrameworkName(names[level[j + 2]])) || (!showSystem && isSystemName(names[level[j + 2]]));
|
||||
if (collapsed) {
|
||||
while (
|
||||
j < level.length - 3 &&
|
||||
barIndex + numBarTicks === level[j + 3] &&
|
||||
level[j + 4] * pxPerTick <= collapseThreshold &&
|
||||
inQuery === ((query && names[level[j + 5]].indexOf(query) >= 0) || false)
|
||||
) {
|
||||
j += 3;
|
||||
numBarTicks += level[j + 1];
|
||||
}
|
||||
}
|
||||
|
||||
const sw = numBarTicks * pxPerTick - (collapsed ? 0 : 0.5);
|
||||
const sh = pxPerLevel - 0.5;
|
||||
|
||||
if (x < -1 || x + sw > graphWidth + 1 || sw < hideThreshold) continue;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.rect(x, y, sw, sh);
|
||||
|
||||
const ratio = numBarTicks / numTopLevelTicks;
|
||||
|
||||
if (!collapsed) {
|
||||
ctx.stroke();
|
||||
const intensity = Math.min(1, (ratio * Math.pow(1.16, i)) / (rangeMax - rangeMin));
|
||||
const h = 50 - 50 * intensity;
|
||||
const l = 65 + 7 * intensity;
|
||||
ctx.fillStyle = inQuery ? 'lightgreen' : `hsl(${h}, 100%, ${l}%)`;
|
||||
} else {
|
||||
ctx.fillStyle = inQuery ? 'lightgreen' : '#eee';
|
||||
}
|
||||
ctx.fill();
|
||||
|
||||
if (!collapsed && sw >= labelThreshold) {
|
||||
const percent = Math.round(10000 * ratio) / 100;
|
||||
const name = `${names[level[j + 2]]} (${percent}%, ${numBarTicks} samples)`;
|
||||
|
||||
ctx.save();
|
||||
ctx.clip();
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(name, Math.max(x, 0) + 1, y + sh / 2);
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// pixel coordinates to bar coordinates in the levels array
|
||||
function xyToBar(x, y) {
|
||||
const i = Math.floor(y / pxPerLevel) + topLevel;
|
||||
const j = binarySearchLevel(x, levels[i]);
|
||||
return { i, j };
|
||||
}
|
||||
|
||||
// binary search of a block in a stack level
|
||||
function binarySearchLevel(x, level) {
|
||||
let i = 0;
|
||||
let j = level.length - 3;
|
||||
while (i <= j) {
|
||||
const m = 3 * ((i / 3 + j / 3) >> 1);
|
||||
const x0 = tickToX(level[m]);
|
||||
const x1 = tickToX(level[m] + level[m + 1]);
|
||||
if (x0 <= x && x1 >= x) {
|
||||
return x1 - x0 > collapseThreshold ? m : -1;
|
||||
}
|
||||
if (x0 > x) {
|
||||
j = m - 3;
|
||||
} else {
|
||||
i = m + 3;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (window.orientation === undefined) {
|
||||
canvas.onmousemove = addHover;
|
||||
canvas.onmouseout = window.onscroll = removeHover;
|
||||
}
|
||||
|
||||
function removeHover() {
|
||||
canvas.style.cursor = '';
|
||||
highlightEl.style.display = 'none';
|
||||
tooltipEl.style.display = 'none';
|
||||
}
|
||||
|
||||
function addHover(e) {
|
||||
const { i, j } = xyToBar(e.offsetX, e.offsetY);
|
||||
|
||||
if (j === -1 || e.offsetX < 0 || e.offsetX > graphWidth) {
|
||||
removeHover();
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.style.cursor = 'pointer';
|
||||
|
||||
const level = levels[i];
|
||||
const x = tickToX(level[j]);
|
||||
const y = (i - topLevel) * pxPerLevel;
|
||||
const sw = tickToX(level[j] + level[j + 1]) - x;
|
||||
|
||||
highlightEl.style.display = 'block';
|
||||
highlightEl.style.left = x + 'px';
|
||||
highlightEl.style.top = canvas.offsetTop + y + 'px';
|
||||
highlightEl.style.width = sw + 'px';
|
||||
|
||||
const numBarTicks = level[j + 1];
|
||||
const percent = Math.round((10000 * numBarTicks) / numTopLevelTicks) / 100;
|
||||
const time = `<span class="time">(${percent}%, ${numBarTicks} samples)</span>`;
|
||||
let content = names[level[j + 2]];
|
||||
if (content[0] !== '(') content = content.replace(' ', ` ${time}<br><span class="path">`) + '</span>';
|
||||
else content += ` ${time}`;
|
||||
|
||||
tooltipEl.innerHTML = content;
|
||||
tooltipEl.style.display = 'block';
|
||||
tooltipEl.style.left = Math.min(e.offsetX + 15 + tooltipEl.clientWidth, graphWidth) - tooltipEl.clientWidth + 'px';
|
||||
tooltipEl.style.top = canvas.offsetTop + e.offsetY + 12 + 'px';
|
||||
}
|
||||
|
||||
// (function frame() { if (levels) render(); requestAnimationFrame(frame); })();
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,4 @@
|
|||
names = ["(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:10","~r file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:33","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3483322","~(anonymous) :1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3611635","(lib) C:\\git\\oufr-jg\\node_modules\\puppeteer\\.local-chromium\\win64-672088\\chrome-win\\chrome_child.dll","~(anonymous) :4:36","~webpackContext :26:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3613606","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:201883","(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3054999","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2683435","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3467142","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2064879","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2703916","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2596685","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2063097","~mergeStyleSets :16:24","~styleToRegistration :401:29","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3318432","~r.d file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:181","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1890615","~(anonymous) :22995:53","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3192585","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3453578","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2812521","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2586697","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3435617","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2834004","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3048106","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2839587","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2636111","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3614036","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2161985","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3620238","~Selection.setItems :64:45","~lib_initializeIcons :2289:29","~(anonymous) :2291:624","~fabric_icons_2_initializeIcons :339:40","~registerIcons :94:23","~registerIconAliases :2247:36","~registerIconAlias :152:27","~render :266:336","~Si :264:12","~Hi :251:12","~(anonymous) :264:339","~Pi.render :261:29","~Ki :253:42","~Ji :252:12","~qf :243:12","~Xh :245:83","~Yh :248:12","~Di :249:12","~ci :233:12","~bi :232:12","~Tg :177:12","~S :164:45","~(anonymous) :145:114","~v :142:337","~p :140:224","~Ye :122:12","~K :118:419","~Ue :118:12","~ai :222:12","~Og :167:12","~Qg :173:12","~obj.<computed> :264:36","~BaseButton.render :387:44","~BaseButton._onRenderContent :496:54","~Button :505:31","~vf :132:12","~BaseButton :102:24","~BaseComponent :70:27","~_makeAllSafe :252:22","~_makeSafe :257:19","~Mf :148:385","~re :108:12","~DefaultButton.render :75:47","~BaseComponent._warnConditionallyRequiredProps :230:72","~(anonymous) :41:183","~tc :55:12","~Lf :148:288","~assign :50:16","~filteredAssign :70:24","~ComponentWithInjectedProps.render :39:72","~M :15:11","~se :109:12","~BaseComponent._warnDeprecations :212:58","~memoizedFunction :73:37","~BaseButton._this._onRenderTextContents :127:48","~BaseButton._this._onRenderText :136:40","~xf :134:12","~Customizations.getSettings :31:43","~DefaultButton :67:27","~initializeFocusRects :22:30","~getId :98:15","~getNativeProps :393:24","~(anonymous) :398:92","~qc :49:12","~pc :48:127","~we :110:12","~Id :87:12","~Cg :163:12","~xe :110:125","~get :116:23","~lh :194:140","~Ve :119:12","~he :101:184","~getWindow :22:19","~oc :48:12","~M :186:11","~c :138:170","~ke :103:12","~_normalizeArg :100:23","~Af :136:12","~ge :101:12","~memoizeFunction :63:25","~qe :107:12","~ComponentWithInjectedProps :28:52","~E :13:11","~BaseButton._this._onRenderAriaDescription :163:51","~initializeDir :31:23","~get :370:23","~Fi :250:12","~exports.unstable_runWithPriority :18:42","~(anonymous) :250:265","~Zh :219:12","~Th :214:12","~Vh :216:12","~ComponentWithInjectedProps.componentDidMount :33:83","~Customizations.observe :49:39"];
|
||||
levels = [[0,1,0,0,454,12],[0,1,1,0,454,1],[0,1,2,0,454,2],[0,1,3,0,454,3],[0,1,4,0,454,4],[0,1,5,0,454,5],[0,1,3,0,11,3,0,2,39,0,441,45],[0,1,6,0,11,6,0,1,7,0,1,43,0,441,46],[0,1,5,0,11,5,0,1,40,0,1,44,0,441,47],[0,1,7,0,11,7,0,1,41,0,1,7,0,441,48],[0,1,8,0,11,8,0,1,42,1,441,49],[0,1,9,0,11,9,0,1,7,1,441,50],[0,1,3,0,11,3,0,1,7,1,441,51],[0,1,10,0,9,10,0,1,35,0,1,37,2,441,52],[0,1,5,0,9,5,0,1,5,0,1,5,2,441,53],[0,1,3,0,9,3,0,1,3,0,1,38,2,441,54],[0,1,11,0,9,11,0,1,36,0,1,7,2,441,55],[0,1,7,0,9,5,0,1,7,3,1,7,0,434,56,0,6,126],[0,1,7,0,5,3,0,3,7,0,1,25,0,1,7,4,3,7,0,431,57,0,6,127],[1,1,13,0,1,22,0,1,24,0,1,26,0,1,29,3,1,7,8,11,7,0,295,58,0,125,66,0,6,128],[1,1,5,0,1,5,0,1,5,0,1,5,0,1,5,23,18,7,0,37,59,0,216,67,0,13,82,0,7,84,0,1,105,0,2,106,0,1,113,0,66,7,0,7,12,0,1,78,0,3,79,0,26,83,0,10,89,0,1,103,0,4,108,0,5,115,0,1,118,0,1,120,0,6,129],[1,1,3,0,1,23,0,1,7,0,1,3,0,1,3,41,5,7,0,32,60,0,5,7,0,137,68,0,66,73,0,8,94,0,6,7,0,5,88,0,2,95,0,2,7,0,5,110,0,1,7,0,2,7,0,1,7,65,1,7,0,7,7,0,1,7,0,3,7,0,16,7,0,7,101,0,3,112,0,6,7,0,4,104,0,1,7,0,4,7,0,1,7,0,4,12,0,1,7,0,1,7,0,1,7,0,1,130,0,4,131],[1,1,14,0,1,7,1,1,27,0,1,30,46,9,7,0,10,61,0,11,63,0,2,114,5,7,7,0,13,59,0,114,69,0,3,87,0,7,7,0,42,74,0,16,96,0,1,121,0,8,7,4,2,7,0,5,7,0,2,7,2,4,7,0,1,118,79,2,7,14,2,7,0,3,7,0,4,102,0,3,7,6,4,7,4,1,7,1,4,7,3,1,7,0,3,7,0,1,132],[1,1,5,0,1,7,1,1,5,0,1,5,55,4,7,0,6,62,0,1,7,0,9,64,0,1,109,0,2,7,12,13,60,0,1,7,0,95,70,0,18,80,0,1,7,0,2,88,7,14,7,0,10,75,0,11,81,0,1,90,0,5,98,0,1,119,0,16,75,0,1,122,18,1,7,8,1,7,79,2,7,19,4,7,30,1,133],[1,1,3,2,1,3,0,1,3,59,1,7,0,4,63,0,1,117,1,5,7,0,4,65,0,1,7,14,6,7,0,7,63,1,8,7,0,43,71,0,21,85,0,5,91,0,18,99,0,6,7,0,8,88,0,4,91,1,2,7,15,6,7,0,8,76,0,1,97,0,1,124,0,2,7,0,9,107,0,1,7,0,5,7,0,1,7,0,1,7,0,10,76,0,5,97,0,1,7,162,1,7],[1,1,15,2,1,28,0,1,31,60,4,64,0,1,7,6,4,7,21,6,64,0,1,109,9,7,7,0,36,72,0,7,7,0,14,86,0,4,7,0,1,116,0,1,7,0,17,86,4,2,7,0,8,7,0,4,7,24,1,7,0,7,77,0,1,7,0,1,7,2,9,7,8,1,7,0,9,77,0,3,7,0,2,111],[1,1,5,2,1,5,0,1,5,60,2,7,0,2,65,32,3,7,0,3,65,0,1,7,16,9,7,0,12,88,0,13,92,0,1,123,0,1,125,0,7,7,0,14,7,4,1,7,1,5,7,0,12,100,43,7,7,9,4,7,9,9,7,3,2,7],[1,1,3,2,1,7,0,1,3,62,2,7,35,3,7,23,3,7,0,12,7,0,3,7,0,3,88,0,7,93,0,1,7,0,1,7,32,12,7,47,3,7,9,4,7,14,4,7],[1,1,16,3,1,32,143,3,7,0,4,7,0,3,88,39,7,7],[1,1,5,3,1,5,150,3,7],[1,1,3,3,1,3],[1,1,17,3,1,33],[1,1,5,3,1,5],[1,1,3,3,1,3],[1,1,18,3,1,34],[1,1,5,3,1,7],[1,1,3,3,1,7],[1,1,19],[1,1,5],[1,1,20],[1,1,21],[1,1,7],[1,1,7]];
|
||||
numTicks = 455;
|
||||
module.exports = { names, levels, numTicks };
|
|
@ -0,0 +1,439 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>flamebearer</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font: 16px 'Helvetica Neue', sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body.hover {
|
||||
background: #cfc;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 30px;
|
||||
margin: 30px 30px 15px;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#fire-icon {
|
||||
fill: #f53;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
vertical-align: -1px;
|
||||
}
|
||||
|
||||
#intro {
|
||||
margin: 0 30px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 13px;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
code span {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#controls {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#search {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#highlight {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
background: #ffffff40;
|
||||
}
|
||||
|
||||
.loaded #intro {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.loaded #header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
padding: 7px 10px;
|
||||
}
|
||||
|
||||
.loaded h1 {
|
||||
font-size: 22px;
|
||||
margin: 0 auto 0 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.loaded #fire-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.loaded #controls {
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#tooltip {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
background: #ffffff;
|
||||
white-space: nowrap;
|
||||
box-shadow: 1px 2px 4px 0px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 2px;
|
||||
padding: 3px 5px;
|
||||
font: 12px Tahoma, sans-serif;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tooltip .path {
|
||||
color: #888;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#tooltip .time {
|
||||
color: #4a4;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1>
|
||||
<svg
|
||||
id="fire-icon"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 15 15"
|
||||
style="enable-background:new 0 0 15 15;"
|
||||
xml:space="preserve"
|
||||
>
|
||||
<path
|
||||
d="M7.5,0.5L5,4.5l-1.5-2 C2.9452,3.4753,0.8036,5.7924,0.8036,8.3036C0.8036,12.002,3.8017,15,7.5,15s6.6964-2.998,6.6964-6.6964 c0-2.5112-2.1416-4.8283-2.6964-5.8036l-1.5,2L7.5,0.5z M7.5,7c0,0,2.5,2.5618,2.5,4.5c0,0.8371-0.8259,2-2.5,2S5,12.3371,5,11.5 C5,9.6283,7.5,7,7.5,7z"
|
||||
/>
|
||||
</svg>
|
||||
<a href="https://github.com/mapbox/flamebearer">flamebearer</a>
|
||||
</h1>
|
||||
<div id="controls">
|
||||
<input id="search" placeholder="Search..." />
|
||||
<button id="reset">Reset view</button><br />
|
||||
<input id="framework" type="checkbox" /><label for="framework">Include Framework</label><br />
|
||||
<input id="system" type="checkbox" /><label for="system">Include System</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="highlight"></div>
|
||||
<div id="tooltip"></div>
|
||||
<div id="intro">
|
||||
<!-- -->
|
||||
</div>
|
||||
<canvas id="canvas" height="0"></canvas>
|
||||
|
||||
<!-- -->
|
||||
<script>const frameworkName = /~([a-zA-Z]{1,2}|[a-zA-Z]{1}\.[a-zA-Z]{1})[\. ]|~render |~\(anonymous\)|\(unknown\)|\~webpack/;
|
||||
const systemName = /\(C\+\+\)|\(lib\)/;
|
||||
|
||||
function isFrameworkName(name) {
|
||||
return frameworkName.test(name);
|
||||
}
|
||||
|
||||
function isSystemName(name) {
|
||||
return systemName.test(name);
|
||||
}
|
||||
|
||||
|
||||
'use strict';
|
||||
|
||||
const introEl = document.getElementById('intro');
|
||||
const searchEl = document.getElementById('search');
|
||||
const highlightEl = document.getElementById('highlight');
|
||||
const tooltipEl = document.getElementById('tooltip');
|
||||
const frameworkEl = document.getElementById('framework');
|
||||
const systemEl = document.getElementById('system');
|
||||
const canvas = document.getElementById('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
let names, levels, numTicks;
|
||||
|
||||
names = ["(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:10","~r file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:33","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3483322","~(anonymous) :1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3611635","(lib) C:\\git\\oufr-jg\\node_modules\\puppeteer\\.local-chromium\\win64-672088\\chrome-win\\chrome_child.dll","~(anonymous) :4:36","~webpackContext :26:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3613606","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:201883","(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3054999","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2683435","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3467142","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2064879","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2703916","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2596685","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2063097","~mergeStyleSets :16:24","~styleToRegistration :401:29","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3318432","~r.d file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:181","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1890615","~(anonymous) :22995:53","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3192585","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3453578","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2812521","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2586697","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3435617","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2834004","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3048106","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2839587","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2636111","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3614036","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2161985","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3620238","~Selection.setItems :64:45","~lib_initializeIcons :2289:29","~(anonymous) :2291:624","~fabric_icons_2_initializeIcons :339:40","~registerIcons :94:23","~registerIconAliases :2247:36","~registerIconAlias :152:27","~render :266:336","~Si :264:12","~Hi :251:12","~(anonymous) :264:339","~Pi.render :261:29","~Ki :253:42","~Ji :252:12","~qf :243:12","~Xh :245:83","~Yh :248:12","~Di :249:12","~ci :233:12","~bi :232:12","~Tg :177:12","~S :164:45","~(anonymous) :145:114","~v :142:337","~p :140:224","~Ye :122:12","~K :118:419","~Ue :118:12","~ai :222:12","~Og :167:12","~Qg :173:12","~obj.<computed> :264:36","~BaseButton.render :387:44","~BaseButton._onRenderContent :496:54","~Button :505:31","~vf :132:12","~BaseButton :102:24","~BaseComponent :70:27","~_makeAllSafe :252:22","~_makeSafe :257:19","~Mf :148:385","~re :108:12","~DefaultButton.render :75:47","~BaseComponent._warnConditionallyRequiredProps :230:72","~(anonymous) :41:183","~tc :55:12","~Lf :148:288","~assign :50:16","~filteredAssign :70:24","~ComponentWithInjectedProps.render :39:72","~M :15:11","~se :109:12","~BaseComponent._warnDeprecations :212:58","~memoizedFunction :73:37","~BaseButton._this._onRenderTextContents :127:48","~BaseButton._this._onRenderText :136:40","~xf :134:12","~Customizations.getSettings :31:43","~DefaultButton :67:27","~initializeFocusRects :22:30","~getId :98:15","~getNativeProps :393:24","~(anonymous) :398:92","~qc :49:12","~pc :48:127","~we :110:12","~Id :87:12","~Cg :163:12","~xe :110:125","~get :116:23","~lh :194:140","~Ve :119:12","~he :101:184","~getWindow :22:19","~oc :48:12","~M :186:11","~c :138:170","~ke :103:12","~_normalizeArg :100:23","~Af :136:12","~ge :101:12","~memoizeFunction :63:25","~qe :107:12","~ComponentWithInjectedProps :28:52","~E :13:11","~BaseButton._this._onRenderAriaDescription :163:51","~initializeDir :31:23","~get :370:23","~Fi :250:12","~exports.unstable_runWithPriority :18:42","~(anonymous) :250:265","~Zh :219:12","~Th :214:12","~Vh :216:12","~ComponentWithInjectedProps.componentDidMount :33:83","~Customizations.observe :49:39"];
|
||||
levels = [[0,1,0,0,454,12],[0,1,1,0,454,1],[0,1,2,0,454,2],[0,1,3,0,454,3],[0,1,4,0,454,4],[0,1,5,0,454,5],[0,1,3,0,11,3,0,2,39,0,441,45],[0,1,6,0,11,6,0,1,7,0,1,43,0,441,46],[0,1,5,0,11,5,0,1,40,0,1,44,0,441,47],[0,1,7,0,11,7,0,1,41,0,1,7,0,441,48],[0,1,8,0,11,8,0,1,42,1,441,49],[0,1,9,0,11,9,0,1,7,1,441,50],[0,1,3,0,11,3,0,1,7,1,441,51],[0,1,10,0,9,10,0,1,35,0,1,37,2,441,52],[0,1,5,0,9,5,0,1,5,0,1,5,2,441,53],[0,1,3,0,9,3,0,1,3,0,1,38,2,441,54],[0,1,11,0,9,11,0,1,36,0,1,7,2,441,55],[0,1,7,0,9,5,0,1,7,3,1,7,0,434,56,0,6,126],[0,1,7,0,5,3,0,3,7,0,1,25,0,1,7,4,3,7,0,431,57,0,6,127],[1,1,13,0,1,22,0,1,24,0,1,26,0,1,29,3,1,7,8,11,7,0,295,58,0,125,66,0,6,128],[1,1,5,0,1,5,0,1,5,0,1,5,0,1,5,23,18,7,0,37,59,0,216,67,0,13,82,0,7,84,0,1,105,0,2,106,0,1,113,0,66,7,0,7,12,0,1,78,0,3,79,0,26,83,0,10,89,0,1,103,0,4,108,0,5,115,0,1,118,0,1,120,0,6,129],[1,1,3,0,1,23,0,1,7,0,1,3,0,1,3,41,5,7,0,32,60,0,5,7,0,137,68,0,66,73,0,8,94,0,6,7,0,5,88,0,2,95,0,2,7,0,5,110,0,1,7,0,2,7,0,1,7,65,1,7,0,7,7,0,1,7,0,3,7,0,16,7,0,7,101,0,3,112,0,6,7,0,4,104,0,1,7,0,4,7,0,1,7,0,4,12,0,1,7,0,1,7,0,1,7,0,1,130,0,4,131],[1,1,14,0,1,7,1,1,27,0,1,30,46,9,7,0,10,61,0,11,63,0,2,114,5,7,7,0,13,59,0,114,69,0,3,87,0,7,7,0,42,74,0,16,96,0,1,121,0,8,7,4,2,7,0,5,7,0,2,7,2,4,7,0,1,118,79,2,7,14,2,7,0,3,7,0,4,102,0,3,7,6,4,7,4,1,7,1,4,7,3,1,7,0,3,7,0,1,132],[1,1,5,0,1,7,1,1,5,0,1,5,55,4,7,0,6,62,0,1,7,0,9,64,0,1,109,0,2,7,12,13,60,0,1,7,0,95,70,0,18,80,0,1,7,0,2,88,7,14,7,0,10,75,0,11,81,0,1,90,0,5,98,0,1,119,0,16,75,0,1,122,18,1,7,8,1,7,79,2,7,19,4,7,30,1,133],[1,1,3,2,1,3,0,1,3,59,1,7,0,4,63,0,1,117,1,5,7,0,4,65,0,1,7,14,6,7,0,7,63,1,8,7,0,43,71,0,21,85,0,5,91,0,18,99,0,6,7,0,8,88,0,4,91,1,2,7,15,6,7,0,8,76,0,1,97,0,1,124,0,2,7,0,9,107,0,1,7,0,5,7,0,1,7,0,1,7,0,10,76,0,5,97,0,1,7,162,1,7],[1,1,15,2,1,28,0,1,31,60,4,64,0,1,7,6,4,7,21,6,64,0,1,109,9,7,7,0,36,72,0,7,7,0,14,86,0,4,7,0,1,116,0,1,7,0,17,86,4,2,7,0,8,7,0,4,7,24,1,7,0,7,77,0,1,7,0,1,7,2,9,7,8,1,7,0,9,77,0,3,7,0,2,111],[1,1,5,2,1,5,0,1,5,60,2,7,0,2,65,32,3,7,0,3,65,0,1,7,16,9,7,0,12,88,0,13,92,0,1,123,0,1,125,0,7,7,0,14,7,4,1,7,1,5,7,0,12,100,43,7,7,9,4,7,9,9,7,3,2,7],[1,1,3,2,1,7,0,1,3,62,2,7,35,3,7,23,3,7,0,12,7,0,3,7,0,3,88,0,7,93,0,1,7,0,1,7,32,12,7,47,3,7,9,4,7,14,4,7],[1,1,16,3,1,32,143,3,7,0,4,7,0,3,88,39,7,7],[1,1,5,3,1,5,150,3,7],[1,1,3,3,1,3],[1,1,17,3,1,33],[1,1,5,3,1,5],[1,1,3,3,1,3],[1,1,18,3,1,34],[1,1,5,3,1,7],[1,1,3,3,1,7],[1,1,19],[1,1,5],[1,1,20],[1,1,21],[1,1,7],[1,1,7]];
|
||||
numTicks = 455;
|
||||
|
||||
|
||||
let rangeMin = 0;
|
||||
let rangeMax = 1;
|
||||
let topLevel = 0;
|
||||
let query = '';
|
||||
let showFramework = false;
|
||||
let showSystem = false;
|
||||
let graphWidth, pxPerTick;
|
||||
|
||||
const pxPerLevel = 18;
|
||||
const collapseThreshold = 1;
|
||||
const hideThreshold = 0.5;
|
||||
const labelThreshold = 20;
|
||||
|
||||
let numTopLevelTicks = numTicks;
|
||||
|
||||
highlightEl.style.height = pxPerLevel + 'px';
|
||||
|
||||
if (levels) {
|
||||
init();
|
||||
}
|
||||
|
||||
function init() {
|
||||
document.body.classList.add('loaded');
|
||||
|
||||
// delta-decode bar positions
|
||||
for (const level of levels) {
|
||||
let prev = 0;
|
||||
for (let i = 0; i < level.length; i += 3) {
|
||||
level[i] += prev;
|
||||
prev = level[i] + level[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
updateFromHash();
|
||||
render();
|
||||
}
|
||||
|
||||
window.onhashchange = () => {
|
||||
updateFromHash();
|
||||
render();
|
||||
};
|
||||
canvas.onclick = e => {
|
||||
const { i, j } = xyToBar(e.offsetX, e.offsetY);
|
||||
if (j === -1) return;
|
||||
window.location.hash = [i, j].join(',');
|
||||
removeHover();
|
||||
};
|
||||
document.getElementById('reset').onclick = () => {
|
||||
searchEl.value = query = '';
|
||||
window.location.hash = '';
|
||||
render();
|
||||
};
|
||||
window.onresize = render;
|
||||
|
||||
searchEl.oninput = e => {
|
||||
query = e.target.value;
|
||||
render();
|
||||
};
|
||||
|
||||
frameworkEl.onchange = e => {
|
||||
showFramework = frameworkEl.checked;
|
||||
render();
|
||||
};
|
||||
|
||||
systemEl.onchange = e => {
|
||||
showSystem = systemEl.checked;
|
||||
render();
|
||||
};
|
||||
|
||||
function updateFromHash() {
|
||||
const [i, j] = window.location.hash
|
||||
.substr(1)
|
||||
.split(',')
|
||||
.map(Number);
|
||||
|
||||
if (!isNaN(i) && !isNaN(j)) {
|
||||
topLevel = i;
|
||||
numTopLevelTicks = levels[i][j + 1];
|
||||
rangeMin = levels[i][j] / numTicks;
|
||||
rangeMax = (levels[i][j] + levels[i][j + 1]) / numTicks;
|
||||
} else {
|
||||
topLevel = 0;
|
||||
numTopLevelTicks = numTicks;
|
||||
rangeMin = 0;
|
||||
rangeMax = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function tickToX(i) {
|
||||
return (i - numTicks * rangeMin) * pxPerTick;
|
||||
}
|
||||
|
||||
function render() {
|
||||
if (!levels) return;
|
||||
|
||||
graphWidth = canvas.width = canvas.clientWidth;
|
||||
canvas.height = pxPerLevel * (levels.length - topLevel);
|
||||
canvas.style.height = canvas.height + 'px';
|
||||
|
||||
if (devicePixelRatio > 1) {
|
||||
canvas.width *= 2;
|
||||
canvas.height *= 2;
|
||||
ctx.scale(2, 2);
|
||||
}
|
||||
|
||||
pxPerTick = graphWidth / numTicks / (rangeMax - rangeMin);
|
||||
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.font = '10px Tahoma, sans-serif';
|
||||
ctx.strokeStyle = 'white';
|
||||
|
||||
for (let i = 0; i < levels.length - topLevel; i++) {
|
||||
const level = levels[topLevel + i];
|
||||
|
||||
for (let j = 0; j < level.length; j += 3) {
|
||||
const barIndex = level[j];
|
||||
const x = tickToX(barIndex);
|
||||
const y = i * pxPerLevel;
|
||||
let numBarTicks = level[j + 1];
|
||||
|
||||
const inQuery = (query && names[level[j + 2]].indexOf(query) >= 0) || false;
|
||||
|
||||
// merge very small blocks into big "collapsed" ones for performance
|
||||
// const collapsed = numBarTicks * pxPerTick <= collapseThreshold;
|
||||
const collapsed = (!showFramework && isFrameworkName(names[level[j + 2]])) || (!showSystem && isSystemName(names[level[j + 2]]));
|
||||
if (collapsed) {
|
||||
while (
|
||||
j < level.length - 3 &&
|
||||
barIndex + numBarTicks === level[j + 3] &&
|
||||
level[j + 4] * pxPerTick <= collapseThreshold &&
|
||||
inQuery === ((query && names[level[j + 5]].indexOf(query) >= 0) || false)
|
||||
) {
|
||||
j += 3;
|
||||
numBarTicks += level[j + 1];
|
||||
}
|
||||
}
|
||||
|
||||
const sw = numBarTicks * pxPerTick - (collapsed ? 0 : 0.5);
|
||||
const sh = pxPerLevel - 0.5;
|
||||
|
||||
if (x < -1 || x + sw > graphWidth + 1 || sw < hideThreshold) continue;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.rect(x, y, sw, sh);
|
||||
|
||||
const ratio = numBarTicks / numTopLevelTicks;
|
||||
|
||||
if (!collapsed) {
|
||||
ctx.stroke();
|
||||
const intensity = Math.min(1, (ratio * Math.pow(1.16, i)) / (rangeMax - rangeMin));
|
||||
const h = 50 - 50 * intensity;
|
||||
const l = 65 + 7 * intensity;
|
||||
ctx.fillStyle = inQuery ? 'lightgreen' : `hsl(${h}, 100%, ${l}%)`;
|
||||
} else {
|
||||
ctx.fillStyle = inQuery ? 'lightgreen' : '#eee';
|
||||
}
|
||||
ctx.fill();
|
||||
|
||||
if (!collapsed && sw >= labelThreshold) {
|
||||
const percent = Math.round(10000 * ratio) / 100;
|
||||
const name = `${names[level[j + 2]]} (${percent}%, ${numBarTicks} samples)`;
|
||||
|
||||
ctx.save();
|
||||
ctx.clip();
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(name, Math.max(x, 0) + 1, y + sh / 2);
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// pixel coordinates to bar coordinates in the levels array
|
||||
function xyToBar(x, y) {
|
||||
const i = Math.floor(y / pxPerLevel) + topLevel;
|
||||
const j = binarySearchLevel(x, levels[i]);
|
||||
return { i, j };
|
||||
}
|
||||
|
||||
// binary search of a block in a stack level
|
||||
function binarySearchLevel(x, level) {
|
||||
let i = 0;
|
||||
let j = level.length - 3;
|
||||
while (i <= j) {
|
||||
const m = 3 * ((i / 3 + j / 3) >> 1);
|
||||
const x0 = tickToX(level[m]);
|
||||
const x1 = tickToX(level[m] + level[m + 1]);
|
||||
if (x0 <= x && x1 >= x) {
|
||||
return x1 - x0 > collapseThreshold ? m : -1;
|
||||
}
|
||||
if (x0 > x) {
|
||||
j = m - 3;
|
||||
} else {
|
||||
i = m + 3;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (window.orientation === undefined) {
|
||||
canvas.onmousemove = addHover;
|
||||
canvas.onmouseout = window.onscroll = removeHover;
|
||||
}
|
||||
|
||||
function removeHover() {
|
||||
canvas.style.cursor = '';
|
||||
highlightEl.style.display = 'none';
|
||||
tooltipEl.style.display = 'none';
|
||||
}
|
||||
|
||||
function addHover(e) {
|
||||
const { i, j } = xyToBar(e.offsetX, e.offsetY);
|
||||
|
||||
if (j === -1 || e.offsetX < 0 || e.offsetX > graphWidth) {
|
||||
removeHover();
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.style.cursor = 'pointer';
|
||||
|
||||
const level = levels[i];
|
||||
const x = tickToX(level[j]);
|
||||
const y = (i - topLevel) * pxPerLevel;
|
||||
const sw = tickToX(level[j] + level[j + 1]) - x;
|
||||
|
||||
highlightEl.style.display = 'block';
|
||||
highlightEl.style.left = x + 'px';
|
||||
highlightEl.style.top = canvas.offsetTop + y + 'px';
|
||||
highlightEl.style.width = sw + 'px';
|
||||
|
||||
const numBarTicks = level[j + 1];
|
||||
const percent = Math.round((10000 * numBarTicks) / numTopLevelTicks) / 100;
|
||||
const time = `<span class="time">(${percent}%, ${numBarTicks} samples)</span>`;
|
||||
let content = names[level[j + 2]];
|
||||
if (content[0] !== '(') content = content.replace(' ', ` ${time}<br><span class="path">`) + '</span>';
|
||||
else content += ` ${time}`;
|
||||
|
||||
tooltipEl.innerHTML = content;
|
||||
tooltipEl.style.display = 'block';
|
||||
tooltipEl.style.left = Math.min(e.offsetX + 15 + tooltipEl.clientWidth, graphWidth) - tooltipEl.clientWidth + 'px';
|
||||
tooltipEl.style.top = canvas.offsetTop + e.offsetY + 12 + 'px';
|
||||
}
|
||||
|
||||
// (function frame() { if (levels) render(); requestAnimationFrame(frame); })();
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,9 @@
|
|||
Results for C:\git\oufr-jg\apps\perf-test\dist\DetailsRow_ref.data.js => C:\git\oufr-jg\apps\perf-test\dist\DetailsRow.data.js
|
||||
|
||||
numTicks: 1471 => 2750
|
||||
|
||||
Potential Regressions:
|
||||
~DetailsRowBase.render, time consumed: 7% => 30%
|
||||
~getClassNames, time consumed: 1% => 15%
|
||||
~mergeStyleSets, time consumed: 0% => 37%
|
||||
~styleToRegistration, time consumed: 0% => 27%
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,10 @@
|
|||
Results for C:\git\oufr-jg\apps\perf-test\dist\DetailsRowFast_ref.data.js => C:\git\oufr-jg\apps\perf-test\dist\DetailsRowFast.data.js
|
||||
|
||||
numTicks: 1409 => 2695
|
||||
|
||||
Potential Regressions:
|
||||
~DetailsRowBase.render, time consumed: 6% => 27%
|
||||
~extractRules, time consumed: 0% => 20%
|
||||
~getClassNames, time consumed: 1% => 14%
|
||||
~mergeStyleSets, time consumed: 0% => 36%
|
||||
~styleToRegistration, time consumed: 0% => 27%
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,11 @@
|
|||
Results for C:\git\oufr-jg\apps\perf-test\dist\DetailsRowNoStyles_ref.data.js => C:\git\oufr-jg\apps\perf-test\dist\DetailsRowNoStyles.data.js
|
||||
|
||||
numTicks: 1466 => 1948
|
||||
|
||||
Potential Regressions:
|
||||
~CheckBase, time consumed: 1% => 15%
|
||||
~DetailsRowCheckBase, time consumed: 3% => 14%
|
||||
|
||||
New Functions:
|
||||
~mergeStyleSets, time consumed = 23%
|
||||
~styleToRegistration, time consumed = 17%
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,4 @@
|
|||
names = ["(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:10","~r file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:33","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3483322","~(anonymous) :1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3088650","(lib) C:\\git\\oufr-jg\\node_modules\\puppeteer\\.local-chromium\\win64-672088\\chrome-win\\chrome_child.dll","(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:46613","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1873904","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3061894","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2066509","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3611635","~(anonymous) :4:36","~webpackContext :26:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3613606","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:201883","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3206343","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2126512","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2088439","~loadStyles :72:20","~measure :35:17","~(anonymous) :74:22","~applyThemableStyles :138:29","~registerStyles :281:24","~(anonymous) :20377:64","~__extends :44:19","~__ :46:16","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2586697","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3435617","~keyframes :11:19","~Stylesheet.insertRule :129:48","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:12102","~r.d file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:181","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3614036","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2161985","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3617592","~lib_initializeIcons :2289:29","~(anonymous) :2291:624","~fabric_icons_15_initializeIcons :1951:41","~registerIcons :94:23","~render :266:336","~Si :264:12","~Hi :251:12","~(anonymous) :264:339","~Pi.render :261:29","~Ki :253:42","~Ji :252:12","~qf :243:12","~Xh :245:83","~Yh :248:12","~Di :249:12","~ci :233:12","~bi :232:12","~Tg :177:12","~S :164:45","~(anonymous) :145:114","~v :142:337","~p :140:224","~Ye :122:12","~K :118:419","~Ue :118:12","~Og :167:12","~vf :132:12","~DefaultButton :67:27","~BaseComponent :70:27","~_makeAllSafe :252:22","~_makeSafe :257:19","~BaseButton :102:24","~Qg :173:12","~ComponentWithInjectedProps.render :39:72","~M :15:11","~obj.<computed> :264:36","~BaseButton.render :387:44","~BaseButton._onRenderContent :496:54","~Button :505:31","~ai :222:12","~hg :150:12","~FontIcon :34:25","~getNativeProps :393:24","~filteredAssign :70:24","~css :7:13","~assign :50:16","~(anonymous) :41:183","~BaseButton._this._onRenderTextContents :127:48","~DefaultButton.render :75:47","~(anonymous) :398:92","~qe :107:12","~tc :55:12","~memoizedFunction :73:37","~xe :110:125","~BaseComponent._warnConditionallyRequiredProps :230:72","~get :116:23","~BaseButton._this._onRenderText :136:40","~se :109:12","~qc :49:12","~ke :103:12","~we :110:12","~Customizations.getSettings :31:43","~c :138:170","~Eg :163:273","~Lf :148:288","~getId :98:15","~Ng :166:128","~Cg :163:12","~Af :136:12","~re :108:12","~E :13:11","~Ig :185:375","~If :147:394","~pc :48:127","~Id :87:12","~initializeFocusRects :22:30","~J :114:349","~BaseButton._this._onRenderMenuIcon :169:44","~(anonymous) :2:88","~oc :48:12","~Mf :148:385","~BaseButton._this._onRenderAriaDescription :163:51","~lh :194:140","~ComponentWithInjectedProps :28:52","(lib) C:\\WINDOWS\\SYSTEM32\\ntdll.dll","~ge :101:12","~xf :134:12","~_normalizeArg :100:23","~he :101:184","~initializeDir :31:23","~getWindow :22:19","~Fi :250:12","~exports.unstable_runWithPriority :18:42","~(anonymous) :250:265","~Zh :219:12","~Uh :215:12","~Th :214:12","~Vh :216:12"];
|
||||
levels = [[0,1,0,0,646,8],[0,1,1,0,646,1],[0,1,2,0,646,2],[0,1,3,0,646,3],[0,1,4,0,646,4],[0,1,5,0,646,5],[0,1,3,0,15,3,0,1,7,0,1,38,0,629,42],[0,1,6,0,2,6,0,13,13,1,1,7,0,629,43],[0,1,7,0,2,5,0,13,5,1,1,39,0,629,44],[0,1,7,0,2,3,0,13,7,1,1,40,0,629,45],[1,2,9,0,13,14,1,1,41,0,629,46],[1,2,5,0,13,15,1,1,7,0,629,47],[1,1,3,0,1,7,0,13,3,2,629,48],[1,1,10,0,1,7,0,11,16,0,1,35,0,1,37,2,629,49],[1,1,5,1,11,5,0,1,5,0,1,5,2,629,50],[1,1,3,1,11,3,0,1,3,0,1,7,2,629,51],[1,1,11,1,11,17,0,1,36,3,629,52],[1,1,5,1,9,5,0,2,7,0,1,5,3,1,7,0,620,53,0,8,129],[1,1,3,1,4,3,0,1,7,0,2,21,0,1,26,0,1,34,0,2,7,0,1,21,4,2,7,0,618,54,0,8,130],[1,1,12,1,1,18,0,2,29,0,1,33,1,2,22,0,1,27,0,1,7,2,1,22,6,21,7,0,416,55,0,181,77,0,8,131],[1,1,7,1,1,5,0,1,5,0,1,7,0,1,7,1,2,23,0,1,28,0,1,7,2,1,23,26,1,7,0,19,7,0,40,56,0,272,63,0,34,78,0,31,84,0,8,91,0,8,102,0,1,105,0,3,109,0,91,7,0,8,8,0,9,88,0,39,89,0,11,95,0,9,97,0,2,98,0,1,101,0,5,107,0,1,110,0,1,118,0,3,120,0,1,123,0,8,132],[3,1,3,0,1,3,1,1,7,1,2,24,0,1,7,3,1,24,46,5,7,0,35,57,0,6,7,0,72,64,0,189,70,0,2,109,0,3,124,0,2,7,0,32,79,0,9,7,0,10,72,0,11,99,0,1,116,0,8,7,0,5,7,0,1,110,0,2,126,0,1,7,0,3,7,89,2,7,0,7,7,0,1,122,0,9,7,0,27,7,0,11,96,0,1,117,0,6,7,0,1,8,0,4,112,0,1,7,0,8,8,0,2,7,0,1,7,0,5,7,0,1,7,0,1,7,0,3,7,0,1,7,0,1,7,0,1,133,0,2,134,0,4,135],[3,1,19,0,1,30,3,1,7,0,1,25,0,1,7,3,1,7,51,15,7,0,13,58,0,5,60,0,1,100,0,1,106,6,11,7,0,21,65,0,38,69,0,1,114,0,1,121,0,8,7,0,17,56,0,5,71,0,158,73,0,1,104,0,2,7,0,3,7,2,7,7,0,5,72,0,5,80,0,9,82,0,6,90,6,3,7,0,10,7,0,11,7,0,1,7,13,1,7,0,2,7,134,5,7,0,3,7,0,8,111,0,1,7,6,1,7,0,4,7,1,8,7,7,1,7,7,1,7,0,2,7,0,4,7],[3,1,5,0,1,5,4,1,7,71,4,7,0,9,59,0,1,7,0,4,61,0,1,7,0,1,7,17,2,7,0,19,66,0,16,7,0,9,66,0,9,92,0,4,103,0,1,7,0,1,108,8,17,57,0,1,7,0,4,72,0,3,7,0,136,74,0,19,86,0,1,7,12,2,7,0,5,7,0,5,81,0,9,7,0,5,7,0,1,125,189,8,7,28,1,7],[3,1,3,0,1,31,4,1,7,75,2,7,0,6,60,0,1,106,1,1,7,0,3,62,21,3,7,0,14,67,0,2,108,6,10,7,0,2,7,0,4,67,0,1,108,0,1,113,0,1,127,0,2,7,0,7,93,0,4,7,1,1,7,8,5,7,0,10,60,0,2,106,1,4,7,3,17,7,0,46,75,0,28,80,0,32,83,0,13,90,0,8,7,0,8,72,0,3,90,20,1,7,0,4,87,7,2,7,5,1,7,196,1,7],[3,1,20,0,1,32,82,6,61,0,1,7,2,3,7,24,2,7,0,12,68,0,2,7,18,2,7,0,2,68,0,1,7,0,1,7,0,1,128,2,7,7,3,1,7,15,4,7,0,6,61,0,2,7,25,46,76,0,2,7,0,26,81,0,17,7,0,15,81,0,13,7,5,3,7,0,8,7,0,2,7,0,1,125,21,4,7],[3,1,7,0,1,8,82,2,7,0,4,62,32,12,7,22,2,7,2,1,7,7,2,7,23,1,7,0,5,62,27,8,7,0,18,72,0,17,85,0,1,115,0,2,119,2,15,7,0,11,87,12,5,7,0,15,7,12,1,7,18,1,7,23,2,7],[3,1,7,0,1,7,84,4,7,37,7,7,23,1,7,10,2,7,24,5,7,31,4,7,0,18,7,0,2,7,0,7,72,0,8,94,0,1,72,0,2,7,17,11,7],[257,7,7,0,8,72,0,1,7,26,4,7],[264,8,7]];
|
||||
numTicks = 647;
|
||||
module.exports = { names, levels, numTicks };
|
|
@ -0,0 +1,439 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>flamebearer</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font: 16px 'Helvetica Neue', sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body.hover {
|
||||
background: #cfc;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 30px;
|
||||
margin: 30px 30px 15px;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#fire-icon {
|
||||
fill: #f53;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
vertical-align: -1px;
|
||||
}
|
||||
|
||||
#intro {
|
||||
margin: 0 30px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 13px;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
code span {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#controls {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#search {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#highlight {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
background: #ffffff40;
|
||||
}
|
||||
|
||||
.loaded #intro {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.loaded #header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-flow: row wrap;
|
||||
padding: 7px 10px;
|
||||
}
|
||||
|
||||
.loaded h1 {
|
||||
font-size: 22px;
|
||||
margin: 0 auto 0 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.loaded #fire-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.loaded #controls {
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#tooltip {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
background: #ffffff;
|
||||
white-space: nowrap;
|
||||
box-shadow: 1px 2px 4px 0px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 2px;
|
||||
padding: 3px 5px;
|
||||
font: 12px Tahoma, sans-serif;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tooltip .path {
|
||||
color: #888;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#tooltip .time {
|
||||
color: #4a4;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1>
|
||||
<svg
|
||||
id="fire-icon"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 15 15"
|
||||
style="enable-background:new 0 0 15 15;"
|
||||
xml:space="preserve"
|
||||
>
|
||||
<path
|
||||
d="M7.5,0.5L5,4.5l-1.5-2 C2.9452,3.4753,0.8036,5.7924,0.8036,8.3036C0.8036,12.002,3.8017,15,7.5,15s6.6964-2.998,6.6964-6.6964 c0-2.5112-2.1416-4.8283-2.6964-5.8036l-1.5,2L7.5,0.5z M7.5,7c0,0,2.5,2.5618,2.5,4.5c0,0.8371-0.8259,2-2.5,2S5,12.3371,5,11.5 C5,9.6283,7.5,7,7.5,7z"
|
||||
/>
|
||||
</svg>
|
||||
<a href="https://github.com/mapbox/flamebearer">flamebearer</a>
|
||||
</h1>
|
||||
<div id="controls">
|
||||
<input id="search" placeholder="Search..." />
|
||||
<button id="reset">Reset view</button><br />
|
||||
<input id="framework" type="checkbox" /><label for="framework">Include Framework</label><br />
|
||||
<input id="system" type="checkbox" /><label for="system">Include System</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="highlight"></div>
|
||||
<div id="tooltip"></div>
|
||||
<div id="intro">
|
||||
<!-- -->
|
||||
</div>
|
||||
<canvas id="canvas" height="0"></canvas>
|
||||
|
||||
<!-- -->
|
||||
<script>const frameworkName = /~([a-zA-Z]{1,2}|[a-zA-Z]{1}\.[a-zA-Z]{1})[\. ]|~render |~\(anonymous\)|\(unknown\)|\~webpack/;
|
||||
const systemName = /\(C\+\+\)|\(lib\)/;
|
||||
|
||||
function isFrameworkName(name) {
|
||||
return frameworkName.test(name);
|
||||
}
|
||||
|
||||
function isSystemName(name) {
|
||||
return systemName.test(name);
|
||||
}
|
||||
|
||||
|
||||
'use strict';
|
||||
|
||||
const introEl = document.getElementById('intro');
|
||||
const searchEl = document.getElementById('search');
|
||||
const highlightEl = document.getElementById('highlight');
|
||||
const tooltipEl = document.getElementById('tooltip');
|
||||
const frameworkEl = document.getElementById('framework');
|
||||
const systemEl = document.getElementById('system');
|
||||
const canvas = document.getElementById('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
let names, levels, numTicks;
|
||||
|
||||
names = ["(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:10","~r file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:33","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3483322","~(anonymous) :1:1","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3088650","(lib) C:\\git\\oufr-jg\\node_modules\\puppeteer\\.local-chromium\\win64-672088\\chrome-win\\chrome_child.dll","(unknown)","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:46613","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:1873904","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3061894","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2066509","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3611635","~(anonymous) :4:36","~webpackContext :26:24","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3613606","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:201883","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3206343","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2126512","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2088439","~loadStyles :72:20","~measure :35:17","~(anonymous) :74:22","~applyThemableStyles :138:29","~registerStyles :281:24","~(anonymous) :20377:64","~__extends :44:19","~__ :46:16","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2586697","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3435617","~keyframes :11:19","~Stylesheet.insertRule :129:48","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:12102","~r.d file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:181","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3614036","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:2161985","~(anonymous) file:///C:/git/oufr-jg/apps/perf-test/dist/perf-test.js:1:3617592","~lib_initializeIcons :2289:29","~(anonymous) :2291:624","~fabric_icons_15_initializeIcons :1951:41","~registerIcons :94:23","~render :266:336","~Si :264:12","~Hi :251:12","~(anonymous) :264:339","~Pi.render :261:29","~Ki :253:42","~Ji :252:12","~qf :243:12","~Xh :245:83","~Yh :248:12","~Di :249:12","~ci :233:12","~bi :232:12","~Tg :177:12","~S :164:45","~(anonymous) :145:114","~v :142:337","~p :140:224","~Ye :122:12","~K :118:419","~Ue :118:12","~Og :167:12","~vf :132:12","~DefaultButton :67:27","~BaseComponent :70:27","~_makeAllSafe :252:22","~_makeSafe :257:19","~BaseButton :102:24","~Qg :173:12","~ComponentWithInjectedProps.render :39:72","~M :15:11","~obj.<computed> :264:36","~BaseButton.render :387:44","~BaseButton._onRenderContent :496:54","~Button :505:31","~ai :222:12","~hg :150:12","~FontIcon :34:25","~getNativeProps :393:24","~filteredAssign :70:24","~css :7:13","~assign :50:16","~(anonymous) :41:183","~BaseButton._this._onRenderTextContents :127:48","~DefaultButton.render :75:47","~(anonymous) :398:92","~qe :107:12","~tc :55:12","~memoizedFunction :73:37","~xe :110:125","~BaseComponent._warnConditionallyRequiredProps :230:72","~get :116:23","~BaseButton._this._onRenderText :136:40","~se :109:12","~qc :49:12","~ke :103:12","~we :110:12","~Customizations.getSettings :31:43","~c :138:170","~Eg :163:273","~Lf :148:288","~getId :98:15","~Ng :166:128","~Cg :163:12","~Af :136:12","~re :108:12","~E :13:11","~Ig :185:375","~If :147:394","~pc :48:127","~Id :87:12","~initializeFocusRects :22:30","~J :114:349","~BaseButton._this._onRenderMenuIcon :169:44","~(anonymous) :2:88","~oc :48:12","~Mf :148:385","~BaseButton._this._onRenderAriaDescription :163:51","~lh :194:140","~ComponentWithInjectedProps :28:52","(lib) C:\\WINDOWS\\SYSTEM32\\ntdll.dll","~ge :101:12","~xf :134:12","~_normalizeArg :100:23","~he :101:184","~initializeDir :31:23","~getWindow :22:19","~Fi :250:12","~exports.unstable_runWithPriority :18:42","~(anonymous) :250:265","~Zh :219:12","~Uh :215:12","~Th :214:12","~Vh :216:12"];
|
||||
levels = [[0,1,0,0,646,8],[0,1,1,0,646,1],[0,1,2,0,646,2],[0,1,3,0,646,3],[0,1,4,0,646,4],[0,1,5,0,646,5],[0,1,3,0,15,3,0,1,7,0,1,38,0,629,42],[0,1,6,0,2,6,0,13,13,1,1,7,0,629,43],[0,1,7,0,2,5,0,13,5,1,1,39,0,629,44],[0,1,7,0,2,3,0,13,7,1,1,40,0,629,45],[1,2,9,0,13,14,1,1,41,0,629,46],[1,2,5,0,13,15,1,1,7,0,629,47],[1,1,3,0,1,7,0,13,3,2,629,48],[1,1,10,0,1,7,0,11,16,0,1,35,0,1,37,2,629,49],[1,1,5,1,11,5,0,1,5,0,1,5,2,629,50],[1,1,3,1,11,3,0,1,3,0,1,7,2,629,51],[1,1,11,1,11,17,0,1,36,3,629,52],[1,1,5,1,9,5,0,2,7,0,1,5,3,1,7,0,620,53,0,8,129],[1,1,3,1,4,3,0,1,7,0,2,21,0,1,26,0,1,34,0,2,7,0,1,21,4,2,7,0,618,54,0,8,130],[1,1,12,1,1,18,0,2,29,0,1,33,1,2,22,0,1,27,0,1,7,2,1,22,6,21,7,0,416,55,0,181,77,0,8,131],[1,1,7,1,1,5,0,1,5,0,1,7,0,1,7,1,2,23,0,1,28,0,1,7,2,1,23,26,1,7,0,19,7,0,40,56,0,272,63,0,34,78,0,31,84,0,8,91,0,8,102,0,1,105,0,3,109,0,91,7,0,8,8,0,9,88,0,39,89,0,11,95,0,9,97,0,2,98,0,1,101,0,5,107,0,1,110,0,1,118,0,3,120,0,1,123,0,8,132],[3,1,3,0,1,3,1,1,7,1,2,24,0,1,7,3,1,24,46,5,7,0,35,57,0,6,7,0,72,64,0,189,70,0,2,109,0,3,124,0,2,7,0,32,79,0,9,7,0,10,72,0,11,99,0,1,116,0,8,7,0,5,7,0,1,110,0,2,126,0,1,7,0,3,7,89,2,7,0,7,7,0,1,122,0,9,7,0,27,7,0,11,96,0,1,117,0,6,7,0,1,8,0,4,112,0,1,7,0,8,8,0,2,7,0,1,7,0,5,7,0,1,7,0,1,7,0,3,7,0,1,7,0,1,7,0,1,133,0,2,134,0,4,135],[3,1,19,0,1,30,3,1,7,0,1,25,0,1,7,3,1,7,51,15,7,0,13,58,0,5,60,0,1,100,0,1,106,6,11,7,0,21,65,0,38,69,0,1,114,0,1,121,0,8,7,0,17,56,0,5,71,0,158,73,0,1,104,0,2,7,0,3,7,2,7,7,0,5,72,0,5,80,0,9,82,0,6,90,6,3,7,0,10,7,0,11,7,0,1,7,13,1,7,0,2,7,134,5,7,0,3,7,0,8,111,0,1,7,6,1,7,0,4,7,1,8,7,7,1,7,7,1,7,0,2,7,0,4,7],[3,1,5,0,1,5,4,1,7,71,4,7,0,9,59,0,1,7,0,4,61,0,1,7,0,1,7,17,2,7,0,19,66,0,16,7,0,9,66,0,9,92,0,4,103,0,1,7,0,1,108,8,17,57,0,1,7,0,4,72,0,3,7,0,136,74,0,19,86,0,1,7,12,2,7,0,5,7,0,5,81,0,9,7,0,5,7,0,1,125,189,8,7,28,1,7],[3,1,3,0,1,31,4,1,7,75,2,7,0,6,60,0,1,106,1,1,7,0,3,62,21,3,7,0,14,67,0,2,108,6,10,7,0,2,7,0,4,67,0,1,108,0,1,113,0,1,127,0,2,7,0,7,93,0,4,7,1,1,7,8,5,7,0,10,60,0,2,106,1,4,7,3,17,7,0,46,75,0,28,80,0,32,83,0,13,90,0,8,7,0,8,72,0,3,90,20,1,7,0,4,87,7,2,7,5,1,7,196,1,7],[3,1,20,0,1,32,82,6,61,0,1,7,2,3,7,24,2,7,0,12,68,0,2,7,18,2,7,0,2,68,0,1,7,0,1,7,0,1,128,2,7,7,3,1,7,15,4,7,0,6,61,0,2,7,25,46,76,0,2,7,0,26,81,0,17,7,0,15,81,0,13,7,5,3,7,0,8,7,0,2,7,0,1,125,21,4,7],[3,1,7,0,1,8,82,2,7,0,4,62,32,12,7,22,2,7,2,1,7,7,2,7,23,1,7,0,5,62,27,8,7,0,18,72,0,17,85,0,1,115,0,2,119,2,15,7,0,11,87,12,5,7,0,15,7,12,1,7,18,1,7,23,2,7],[3,1,7,0,1,7,84,4,7,37,7,7,23,1,7,10,2,7,24,5,7,31,4,7,0,18,7,0,2,7,0,7,72,0,8,94,0,1,72,0,2,7,17,11,7],[257,7,7,0,8,72,0,1,7,26,4,7],[264,8,7]];
|
||||
numTicks = 647;
|
||||
|
||||
|
||||
let rangeMin = 0;
|
||||
let rangeMax = 1;
|
||||
let topLevel = 0;
|
||||
let query = '';
|
||||
let showFramework = false;
|
||||
let showSystem = false;
|
||||
let graphWidth, pxPerTick;
|
||||
|
||||
const pxPerLevel = 18;
|
||||
const collapseThreshold = 1;
|
||||
const hideThreshold = 0.5;
|
||||
const labelThreshold = 20;
|
||||
|
||||
let numTopLevelTicks = numTicks;
|
||||
|
||||
highlightEl.style.height = pxPerLevel + 'px';
|
||||
|
||||
if (levels) {
|
||||
init();
|
||||
}
|
||||
|
||||
function init() {
|
||||
document.body.classList.add('loaded');
|
||||
|
||||
// delta-decode bar positions
|
||||
for (const level of levels) {
|
||||
let prev = 0;
|
||||
for (let i = 0; i < level.length; i += 3) {
|
||||
level[i] += prev;
|
||||
prev = level[i] + level[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
updateFromHash();
|
||||
render();
|
||||
}
|
||||
|
||||
window.onhashchange = () => {
|
||||
updateFromHash();
|
||||
render();
|
||||
};
|
||||
canvas.onclick = e => {
|
||||
const { i, j } = xyToBar(e.offsetX, e.offsetY);
|
||||
if (j === -1) return;
|
||||
window.location.hash = [i, j].join(',');
|
||||
removeHover();
|
||||
};
|
||||
document.getElementById('reset').onclick = () => {
|
||||
searchEl.value = query = '';
|
||||
window.location.hash = '';
|
||||
render();
|
||||
};
|
||||
window.onresize = render;
|
||||
|
||||
searchEl.oninput = e => {
|
||||
query = e.target.value;
|
||||
render();
|
||||
};
|
||||
|
||||
frameworkEl.onchange = e => {
|
||||
showFramework = frameworkEl.checked;
|
||||
render();
|
||||
};
|
||||
|
||||
systemEl.onchange = e => {
|
||||
showSystem = systemEl.checked;
|
||||
render();
|
||||
};
|
||||
|
||||
function updateFromHash() {
|
||||
const [i, j] = window.location.hash
|
||||
.substr(1)
|
||||
.split(',')
|
||||
.map(Number);
|
||||
|
||||
if (!isNaN(i) && !isNaN(j)) {
|
||||
topLevel = i;
|
||||
numTopLevelTicks = levels[i][j + 1];
|
||||
rangeMin = levels[i][j] / numTicks;
|
||||
rangeMax = (levels[i][j] + levels[i][j + 1]) / numTicks;
|
||||
} else {
|
||||
topLevel = 0;
|
||||
numTopLevelTicks = numTicks;
|
||||
rangeMin = 0;
|
||||
rangeMax = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function tickToX(i) {
|
||||
return (i - numTicks * rangeMin) * pxPerTick;
|
||||
}
|
||||
|
||||
function render() {
|
||||
if (!levels) return;
|
||||
|
||||
graphWidth = canvas.width = canvas.clientWidth;
|
||||
canvas.height = pxPerLevel * (levels.length - topLevel);
|
||||
canvas.style.height = canvas.height + 'px';
|
||||
|
||||
if (devicePixelRatio > 1) {
|
||||
canvas.width *= 2;
|
||||
canvas.height *= 2;
|
||||
ctx.scale(2, 2);
|
||||
}
|
||||
|
||||
pxPerTick = graphWidth / numTicks / (rangeMax - rangeMin);
|
||||
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.font = '10px Tahoma, sans-serif';
|
||||
ctx.strokeStyle = 'white';
|
||||
|
||||
for (let i = 0; i < levels.length - topLevel; i++) {
|
||||
const level = levels[topLevel + i];
|
||||
|
||||
for (let j = 0; j < level.length; j += 3) {
|
||||
const barIndex = level[j];
|
||||
const x = tickToX(barIndex);
|
||||
const y = i * pxPerLevel;
|
||||
let numBarTicks = level[j + 1];
|
||||
|
||||
const inQuery = (query && names[level[j + 2]].indexOf(query) >= 0) || false;
|
||||
|
||||
// merge very small blocks into big "collapsed" ones for performance
|
||||
// const collapsed = numBarTicks * pxPerTick <= collapseThreshold;
|
||||
const collapsed = (!showFramework && isFrameworkName(names[level[j + 2]])) || (!showSystem && isSystemName(names[level[j + 2]]));
|
||||
if (collapsed) {
|
||||
while (
|
||||
j < level.length - 3 &&
|
||||
barIndex + numBarTicks === level[j + 3] &&
|
||||
level[j + 4] * pxPerTick <= collapseThreshold &&
|
||||
inQuery === ((query && names[level[j + 5]].indexOf(query) >= 0) || false)
|
||||
) {
|
||||
j += 3;
|
||||
numBarTicks += level[j + 1];
|
||||
}
|
||||
}
|
||||
|
||||
const sw = numBarTicks * pxPerTick - (collapsed ? 0 : 0.5);
|
||||
const sh = pxPerLevel - 0.5;
|
||||
|
||||
if (x < -1 || x + sw > graphWidth + 1 || sw < hideThreshold) continue;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.rect(x, y, sw, sh);
|
||||
|
||||
const ratio = numBarTicks / numTopLevelTicks;
|
||||
|
||||
if (!collapsed) {
|
||||
ctx.stroke();
|
||||
const intensity = Math.min(1, (ratio * Math.pow(1.16, i)) / (rangeMax - rangeMin));
|
||||
const h = 50 - 50 * intensity;
|
||||
const l = 65 + 7 * intensity;
|
||||
ctx.fillStyle = inQuery ? 'lightgreen' : `hsl(${h}, 100%, ${l}%)`;
|
||||
} else {
|
||||
ctx.fillStyle = inQuery ? 'lightgreen' : '#eee';
|
||||
}
|
||||
ctx.fill();
|
||||
|
||||
if (!collapsed && sw >= labelThreshold) {
|
||||
const percent = Math.round(10000 * ratio) / 100;
|
||||
const name = `${names[level[j + 2]]} (${percent}%, ${numBarTicks} samples)`;
|
||||
|
||||
ctx.save();
|
||||
ctx.clip();
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(name, Math.max(x, 0) + 1, y + sh / 2);
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// pixel coordinates to bar coordinates in the levels array
|
||||
function xyToBar(x, y) {
|
||||
const i = Math.floor(y / pxPerLevel) + topLevel;
|
||||
const j = binarySearchLevel(x, levels[i]);
|
||||
return { i, j };
|
||||
}
|
||||
|
||||
// binary search of a block in a stack level
|
||||
function binarySearchLevel(x, level) {
|
||||
let i = 0;
|
||||
let j = level.length - 3;
|
||||
while (i <= j) {
|
||||
const m = 3 * ((i / 3 + j / 3) >> 1);
|
||||
const x0 = tickToX(level[m]);
|
||||
const x1 = tickToX(level[m] + level[m + 1]);
|
||||
if (x0 <= x && x1 >= x) {
|
||||
return x1 - x0 > collapseThreshold ? m : -1;
|
||||
}
|
||||
if (x0 > x) {
|
||||
j = m - 3;
|
||||
} else {
|
||||
i = m + 3;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (window.orientation === undefined) {
|
||||
canvas.onmousemove = addHover;
|
||||
canvas.onmouseout = window.onscroll = removeHover;
|
||||
}
|
||||
|
||||
function removeHover() {
|
||||
canvas.style.cursor = '';
|
||||
highlightEl.style.display = 'none';
|
||||
tooltipEl.style.display = 'none';
|
||||
}
|
||||
|
||||
function addHover(e) {
|
||||
const { i, j } = xyToBar(e.offsetX, e.offsetY);
|
||||
|
||||
if (j === -1 || e.offsetX < 0 || e.offsetX > graphWidth) {
|
||||
removeHover();
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.style.cursor = 'pointer';
|
||||
|
||||
const level = levels[i];
|
||||
const x = tickToX(level[j]);
|
||||
const y = (i - topLevel) * pxPerLevel;
|
||||
const sw = tickToX(level[j] + level[j + 1]) - x;
|
||||
|
||||
highlightEl.style.display = 'block';
|
||||
highlightEl.style.left = x + 'px';
|
||||
highlightEl.style.top = canvas.offsetTop + y + 'px';
|
||||
highlightEl.style.width = sw + 'px';
|
||||
|
||||
const numBarTicks = level[j + 1];
|
||||
const percent = Math.round((10000 * numBarTicks) / numTopLevelTicks) / 100;
|
||||
const time = `<span class="time">(${percent}%, ${numBarTicks} samples)</span>`;
|
||||
let content = names[level[j + 2]];
|
||||
if (content[0] !== '(') content = content.replace(' ', ` ${time}<br><span class="path">`) + '</span>';
|
||||
else content += ` ${time}`;
|
||||
|
||||
tooltipEl.innerHTML = content;
|
||||
tooltipEl.style.display = 'block';
|
||||
tooltipEl.style.left = Math.min(e.offsetX + 15 + tooltipEl.clientWidth, graphWidth) - tooltipEl.clientWidth + 'px';
|
||||
tooltipEl.style.top = canvas.offsetTop + e.offsetY + 12 + 'px';
|
||||
}
|
||||
|
||||
// (function frame() { if (levels) render(); requestAnimationFrame(frame); })();
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче