All Projects → mbalabash → Estimo

mbalabash / Estimo

Licence: mit
Evaluates how long the browser will execute your javascript code.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Estimo

Element
💦Load test your app using real web browsers
Stars: ✭ 204 (+47.83%)
Mutual labels:  devtools, puppeteer
Vue Perf Devtool
Vue Performance Devtool is a browser extension for inspecting the performance of Vue Components.
Stars: ✭ 510 (+269.57%)
Mutual labels:  devtools, performance
Secret Agent
The web browser that's built for scraping.
Stars: ✭ 151 (+9.42%)
Mutual labels:  devtools, puppeteer
Penthouse
Penthouse is the original critical path css generator, helping you out to speed up page rendering for your websites. Supply your site's full CSS and the page you want to create the critical CSS for, and Penthouse will return the critical CSS needed to perfectly render the above the fold content of the page. Read more about critical path css here.
Stars: ✭ 2,479 (+1696.38%)
Mutual labels:  performance, puppeteer
React Pinpoint
An open source utility library for measuring React component render times.
Stars: ✭ 93 (-32.61%)
Mutual labels:  performance, puppeteer
Profiler
Firefox Profiler — Web app for Firefox performance analysis
Stars: ✭ 546 (+295.65%)
Mutual labels:  devtools, performance
React Performance Observer
Get performance measurements from React Fiber
Stars: ✭ 207 (+50%)
Mutual labels:  devtools, performance
Puppeteer Webperf
Automating Web Performance testing with Puppeteer 🎪
Stars: ✭ 1,392 (+908.7%)
Mutual labels:  devtools, puppeteer
Perftools Runner
Google Performance Tools runner using Puppeteer
Stars: ✭ 79 (-42.75%)
Mutual labels:  performance, puppeteer
Webdriverio
Next-gen browser and mobile automation test framework for Node.js
Stars: ✭ 7,214 (+5127.54%)
Mutual labels:  devtools, performance
Jscost.org
JSCost.org - a JavaScript cost visualizer 💸
Stars: ✭ 101 (-26.81%)
Mutual labels:  devtools, performance
Marionette
Selenium alternative for Crystal. Browser manipulation without the Java overhead.
Stars: ✭ 119 (-13.77%)
Mutual labels:  devtools, puppeteer
Restore
A predictable & observable state container for React apps
Stars: ✭ 133 (-3.62%)
Mutual labels:  devtools
Laravel Responsecache
Speed up a Laravel app by caching the entire response
Stars: ✭ 1,874 (+1257.97%)
Mutual labels:  performance
Screenshoteer
Make website screenshots and mobile emulations from the command line.
Stars: ✭ 1,650 (+1095.65%)
Mutual labels:  puppeteer
Spacechop
HTTP service for high-level image processing with first-class Docker support.
Stars: ✭ 133 (-3.62%)
Mutual labels:  performance
Sltbench
C++ benchmark tool. Practical, stable and fast performance testing framework.
Stars: ✭ 137 (-0.72%)
Mutual labels:  performance
Perf Tools
⏱→ 🚀A set of tools for improving performance your application (balancer, performance, PerfKeeper, LazyPromise).
Stars: ✭ 135 (-2.17%)
Mutual labels:  performance
Minimongoexplorer
Handy Google Chrome extension for reviewing MiniMongo.
Stars: ✭ 131 (-5.07%)
Mutual labels:  devtools
Works For Me
Collection of developer toolkits
Stars: ✭ 131 (-5.07%)
Mutual labels:  devtools

Estimo

Estimo is a tool for measuring parse / compile / execution time of javascript.

This tool can emulate CPU throttling, Network conditions, use Chrome Device emulation and more for measuring javascript performance.

Inspired by Size Limit. Thanks @ai and @aslushnikov for support.

Why?

JavaScript is the most expensive part of our frontend.

3.5 seconds to process 170 KB of JS and 0.1 second for 170 KB of JPEG. @Addy Osmani

3.5 seconds to process 170 KB of JS and 0.1 second for 170 KB of JPEG.

Usage

JS API

const path = require('path')
const estimo = require('estimo')

;(async () => {
  const report = await estimo(path.join(__dirname, 'examples', 'example.js'))
  console.log(report)
})()

CLI

estimo -r ./examples/example.js

Output

[
  {
    name: 'example.js',
    parseHTML: 1.01,
    styleLayout: 34.08,
    paintCompositeRender: 1.4,
    scriptParseCompile: 1.04,
    scriptEvaluation: 8.11,
    javaScript: 9.15,
    garbageCollection: 0,
    other: 8.2,
    total: 53.84,
  },
]

Fields Description

  • name - Resource name (file name or web url).

  • parseHTML - Time which was spent for ParseHTML, ParseAuthorStyleSheet events.

  • styleLayout - Time which was spent for ScheduleStyleRecalculation, UpdateLayoutTree, InvalidateLayout, Layout events.

  • paintCompositeRender - Time which was spent for Animation, HitTest, PaintSetup, Paint, PaintImage, RasterTask, ScrollLayer, UpdateLayer, UpdateLayerTree, CompositeLayers events.

  • scriptParseCompile - Time which was spent for v8.compile, v8.compileModule, v8.parseOnBackground events.

  • scriptEvaluation - Time which was spent for EventDispatch, EvaluateScript, v8.evaluateModule, FunctionCall, TimerFire, FireIdleCallback, FireAnimationFrame, RunMicrotasks, V8.Execute events.

  • javaScript - Time which was spent for both event groups (scriptParseCompile and scriptEvaluation).

  • garbageCollection - Time which was spent for MinorGC, MajorGC, BlinkGC.AtomicPhase, ThreadState::performIdleLazySweep, ThreadState::completeSweep, BlinkGCMarking events.

  • other - Time which was spent for MessageLoop::RunTask, TaskQueueManager::ProcessTaskFromWorkQueue, ThreadControllerImpl::DoWork events.

  • total - Total time.

Time

All metrics are in milliseconds.

We measure system-cpu time. The number of seconds that the process has spent on the CPU.

We not including time spent waiting for its turn on the CPU.

Multiple Runs

All results measured in time. It means that results could be unstable depends on available on your device resources.

You can use runs option to run estimo N times and get median value as a result.

JS API

const report = await estimo(['/path/to/examples/example.js'], { runs: 10 })

CLI

estimo -r /path/to/examples/example.js --runs 10

Diff Mode

You can compare metrics of an origin file with others its versions to understand consequences on performance.

We take the first file as a baseline. All rest files will be compared with the baseline.

JS API

const report = await estimo(['lib-1.0.5.js', 'lib-1.1.0.js'], { diff: true })

CLI

estimo -r lib-1.0.5.js lib-1.1.0.js --diff

Output

[
  {
    name: 'lib-1.0.5.js',
    parseHTML: 1.48,
    styleLayout: 44.61,
    paintCompositeRender: 2.19,
    scriptParseCompile: 1.21,
    scriptEvaluation: 9.63,
    javaScript: 10.84,
    garbageCollection: 0,
    other: 9.95,
    total: 69.06,
  },
  {
    name: 'lib-1.1.0.js',
    parseHTML: 2.97,
    styleLayout: 61.02,
    paintCompositeRender: 2.11,
    scriptParseCompile: 2.11,
    scriptEvaluation: 19.28,
    javaScript: 21.39,
    garbageCollection: 0,
    other: 15.49,
    total: 102.98,
    diff: {
      parseHTML: '2.97 (+50.17% 🔺)',
      styleLayout: '61.02 (+26.9% 🔺)',
      paintCompositeRender: '2.11 (-3.8% 🔽)',
      scriptParseCompile: '2.11 (+42.66% 🔺)',
      scriptEvaluation: '19.28 (+50.06% 🔺)',
      javaScript: '21.39 (+49.33% 🔺)',
      garbageCollection: '0 (N/A)',
      other: '15.49 (+35.77% 🔺)',
      total: '102.98 (+32.94% 🔺)',
    },
  },
]

Additional Use Cases

CPU Throttling Rate

The CPU Throttling Rate Emulation allow you to generate a Performance timeline under specified CPU conditions. To turn on CPU emulation, you must pass the emulateCpuThrottling flag along with additional configuration options.

  • emulateCpuThrottling (default: false) - This flag allows the other CPU Throttling Rate options to be respected. They will be completely ignored unless this flag is set.

  • cpuThrottlingRate (default: 1) - Sets the CPU throttling rate. The number represents the slowdown factor (e.g., 2 is a "2x" slowdown).

JS API:

await estimo('/path/to/example.js', {
  emulateCpuThrottling: true,
  cpuThrottlingRate: 4,
})

CLI:

estimo -r ./examples/example.js --cpu --cpuRate 4

Network Emulation

The Network Emulation allow you to generate a Performance timeline under specified network conditions. To turn on network emulation, you must pass the emulateNetworkConditions flag along with additional configuration options.

  • emulateNetworkConditions (default: false) - This flag allows the other Network Emulation options to be respected. They will be completely ignored unless this flag is set.

  • offline (default: false) - Passing the offline flag to the generate command emulate a network disconnect.

  • latency (default: 0) - Artificial, minimum latency between request sent and response header received expressed in milliseconds (ms).

  • downloadThroughput (default: 0) - The maximum download speed in megabits per second. 0 disables throttling.

  • uploadThroughput (default: 0) - The maximum upload speed in megabits per second. 0 disables throttling.

  • connectionType (default: none) - A label of the supposed underlying network connection type that the browser is using. Supported values are documented under Chrome Headless ConnectType documentation. Variants: none, cellular2g, cellular3g, cellular4g, bluetooth, ethernet, wifi, wimax, other.

JS API:

await estimo('/path/to/example.js', {
  emulateNetworkConditions: true,
  offline: false,
  latency: 150,
  downloadThroughput: 1.6,
  uploadThroughput: 0.75,
  connectionType: 'cellular3g',
})

CLI:

estimo -r ./examples/example.js --net --latency 150 --download 1.6 --upload 0.75 --connection cellular3g

Chrome Device Emulation

The Chrome Device Emulation allow you to generate a Performance timeline under specified device conditions.

JS API

const report = await estimo('/path/to/example.js', {
  device: 'Galaxy S5',
})

CLI

estimo -r ./examples/examples.js -d Galaxy\ S5

When using CLI, for device names with spaces you should use symbols escaping.

Multiple Resources

JS API

const report = await estimo([
  '/path/to/libs/example.js',
  'https://unpkg.com/[email protected]/umd/react.development.js',
])

CLI

estimo -r /path/to/example.js https://unpkg.com/[email protected]/umd/react.development.js

Pages

You can use all features not only with js files, but with web pages too.

We will wait for navigation to be finished when the load event is fired.

JS API

const report = await estimo('https://www.google.com/')

CLI

estimo -r https://www.google.com/

Install

npm i estimo

or

yarn add estimo

How?

It uses puppeteer to generate Chrome Timelines. Which can be transformed in human-readable shape by Tracium.

We will use your local Chrome if it suitable for using with Estimo.

Keep in mind there result depends on your device and available resources.

Who Uses Estimo

Contributing

Pull requests, feature ideas and bug reports are very welcome. We highly appreciate any feedback.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].