./trace-deopt.sh http://localhost:4200
Wait until your page renders.
#!/usr/bin/env node | |
import { chromium } from "playwright"; | |
import { readFileSync } from "node:fs"; | |
import { once } from "node:events"; | |
async function main() { | |
const browser = await chromium.launch({ headless: false }); | |
try { | |
const cookies = await readCookies("cookies.json"); |
/* eslint-env node */ | |
const { Session } = require('inspector'); | |
const fs = require('fs'); | |
const captureExit = require('capture-exit'); | |
captureExit.captureExit(); | |
/** @param exitPromise {Promise<void>} */ | |
async function runProfile(exitPromise) { |
import * as ts from "typescript"; | |
const options: ts.CompilerOptions = { | |
moduleResolution: ts.ModuleResolutionKind.NodeJs, | |
module: ts.ModuleKind.CommonJS, | |
target: ts.ScriptTarget.ES2015, | |
declaration: true | |
}; | |
const host = ts.createCompilerHost(options); |
const fs = require('fs'); | |
const path = require('path'); | |
const spawn = require('child_process').spawn; | |
const FPS = 60; | |
const MICROSEC_PER_FRAME = Math.round(1000000 / FPS); | |
if (process.argv.length < 3) { | |
console.log(`node ${path.relative('.', process.argv[1])} [DevToolsProfile]`); | |
process.exit(1); | |
} | |
let traceFile = path.resolve(process.argv[2]); |
const { Session } = require('inspector'); | |
/** | |
* @param task {() => Promise<void>} | |
* @returns {import('inspector').Profiler.Profile} | |
*/ | |
async function runProfile(task) { | |
const session = new Session(); | |
session.connect(); | |
try { |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 p = (2.0*fragCoord.xy-iResolution.xy)/iResolution.y; | |
// width | |
float wi = 0.5 + 0.3*cos( iTime + 2.0 ); | |
vec2 g = abs(p - wi * round(p/wi)); | |
float d = min(g.x, g.y); | |
// append at end of ember-cli-build.js | |
(() => { | |
const Instrumentation = require("ember-cli/lib/models/instrumentation"); | |
let count = 0; | |
const start = Instrumentation.prototype.start; | |
Instrumentation.prototype.start = function hookedStart(...args) { | |
count++; | |
console.profile(args[0] + count); | |
return Reflect.apply(start, this, args); |
/* eslint-env node */ | |
const Project = require('ember-cli/lib/models/project'); | |
const CLI = require('ember-cli/lib/cli/cli'); | |
const UI = require('console-ui'); | |
const ui = new UI(); | |
const cli = new CLI({ ui }); | |
const project = Project.closestSync(__dirname, ui, cli); | |
const tree = require(`${project.root}/ember-cli-build`)({ project }); | |
module.exports = tree; |
use libc; | |
use serde_json::{json, Value}; | |
use std::error; | |
use std::ffi::OsString; | |
use std::fs::File; | |
use std::io; | |
use std::io::prelude::*; | |
use std::io::{BufReader, BufWriter}; | |
use std::os::unix::io::RawFd; | |
use std::os::unix::prelude::*; |