screepers/screeps-typescript-profiler

Name: screeps-typescript-profiler

Owner: screepers

Description: A light-weight TypeScript profiler for tagging classes and methods

Created: 2017-05-27 02:54:28.0

Updated: 2018-02-03 19:11:26.0

Pushed: 2017-08-23 02:10:56.0

Homepage:

Size: 5

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

screeps-typescript-profiler

A light-weight TypeScript profiler for tagging classes and methods

This project is made as a lightweight alternative to screeps-profiler

Example Output:
iler.output()

tion                                  Tot Calls    CPU/Call  Calls/Tick    CPU/Tick   % of Tot
antWorkerProcess:doWork                    1594      0.29ms        5.69      1.66ms       24 %
pProcess:moveTo                            2629      0.16ms        9.39      1.48ms       22 %
antWorkerProcess:doCharging                 966      0.22ms        3.45      0.77ms       11 %
antWorkerProcess:doScavenging               534      0.38ms        1.91      0.73ms       11 %
tructionWorkerProcess:doWork                267      0.48ms        0.95      0.46ms        7 %
gatorProcess:getPath                        169      0.38ms        0.60      0.23ms        3 %
antWorkerProcess:doUnloading                121      0.42ms        0.43      0.18ms        3 %
antWorkerProcess:getJob                      42      1.07ms        0.15      0.16ms        2 %
gatorProcess:calculateNewPath                63      0.63ms        0.23      0.14ms        2 %
rePathProcess:run                           261      0.14ms        0.93      0.13ms        2 %
pProcess:isEmpty                           1458      0.02ms        5.21      0.11ms        2 %
antWorkerProcess:doRefilling                 20      1.36ms        0.07      0.10ms        1 %
gatorProcess:getCostMatrix                   63      0.42ms        0.23      0.09ms        1 %
pProcess:isFull                             908      0.03ms        3.24      0.08ms        1 %
rePathProcess:decayPaths                     12      1.86ms        0.04      0.08ms        1 %
itectProcess:run                             14      1.51ms        0.05      0.08ms        1 %
itectProcess:supervise                       14      1.45ms        0.05      0.07ms        1 %
itectProcess:placeRoad                       14      1.17ms        0.05      0.06ms        1 %
rePathProcess:growPaths                     261      0.05ms        0.93      0.05ms        1 %
rePathProcess:findRoad                       14      0.82ms        0.05      0.04ms        1 %
total ticks measured            6.87 average CPU profiled per tick
Setup
Usage

The following assumes you attached Profiler to global.Profiler

From the command line:

Profiler.clear() - Clears the profiler data in memory. Useful after refactoring code. (NOTE: this doesn't stop the profiler)

(The profiler is hardcoded to write data to Memory.profiler, so make sure you aren't already using this location)

Profiler.start() - Starts the profiler

Profiler.stop() - Stops/Pauses the profiler

Profiler.status() - Returns whether is profiler is currently running or not

Profiler.output() - Pretty-prints the collected profiler data to the console


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.