Coder Social home page Coder Social logo

uber-web / probe.gl Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 12.0 6.75 MB

A performance instrumentation logging library for Uber frameworks

Home Page: https://uber-web.github.io/probe.gl/#/documentation/overview

License: Other

JavaScript 64.12% HTML 0.28% SCSS 0.08% TypeScript 34.76% Shell 0.20% CSS 0.47% MDX 0.09%
uber

probe.gl's People

Contributors

balthazar avatar dependabot[bot] avatar donmccurdy avatar heshan0131 avatar ibgreen avatar isaacbrodsky avatar jianhuang01 avatar pessimistress avatar tgorkin avatar tsherif avatar xiaokaiuber avatar zbigg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

probe.gl's Issues

Bench: Async benchmark tests run very slow

Background: I'm running a benchmark test where I created an async function with a 5 second delay. The benchmark took 178s on average to run. If I lower the delay to 1 second, the benchmark took 30 seconds, when I increase the delay to 10 seconds, the benchmark took 318s.

Question: I'm curious why a 5 second function took 3 minutes to run, or a 10 second function took 5+ minutes to run. Is this a bug or is Bench intended to take this long?

Note: I noticed after further research that runBenchTestForMinimumTimeAsync has a multiplier of 10 by default on line 306 in bench.ts and it cannot be changed. Is there anything that can be done to be able to control that?

Stats: types should be set on Stats, not StatsWidget

As it stands, the app instantiating a StatsWidget needs to know the names and types of individual stats in the stats object. This contradicts the idea of a Stats object containing a "bag" of useful but non-documented stats, and adds a bunch of fragile "boilerplate" code to apps.

Stats updates round 2

Stats

  • getTable method put things in a format consumable by console.table

StatsWidget

  • Better handling of CSS
  • Default formatter types, e.g. "time", "count", "framerate", "memory"
  • Throttle counter: optional argument to only update every n calls to update
  • Reset counter for individual stats: auto-reset every n calls to update
  • Accept multiple stats objects

Bench: Benchmark group documentation is unclear

As I was looking through the bench.group function, I noticed that it doesn't ever set a test.group parameter to true. In the documentation, it seems to be implied that bench.group will add all tests under it to that group, although that is not what happens. I guess it's unclear when it says group(id) Adds a group header., because what does that actually mean? Some clarity around this would be helpful.

Background: The reason I bring this up is because I noticed benchmark tests are always run at least twice (once for calibration tests, and once for running the benchmarks). Under calibration, I noticed that they're run if test.group is set to false. So should I always expect calibration tests to be run? The only way I have found to only run a benchmark test once is when I set test.group to true.

The documentation I am referring to: https://uber-web.github.io/probe.gl/docs/api-reference/bench/bench

Tracker: Docs

  • Many docs are still marked as WIP
  • get-started section should be built into Developer's Guide
  • doc/get-started structure doesn't well reflect the multiple modules

StatsWidget: Allow resetting StatsWidget to new Stats object

This happens for instance in 3d-tiles demo, where each Tileset3D has a stats object, and the StatsWidget need to be updated when a new tileset is loaded.

Either provide

  • a way to reset the stats object, or
  • a way to destroy the stats widget (so that a new one can be created)
    or better yet, provide both...

StatsWidget: (Idea) allow developer to show stats widgets from console

For discussion:

In probe we already store log settings in local storage.

We could also have StatsWidgets hidden by default and offer a console command to enable them.

> probe.stats = true // or
> probe.showStats()

This way, devs could easily turn on stats after a new release or when they think they see regressions.

Allow Stats class to track a time window.

Deck usage requires gathering measurements that only become visible after a certain number of measurements. The Stats object should support this usage. I think the simplest way to do this would that the Stats object should have a windowSize property. Calls to stat updates like incrementCount, addTime, etc. should only update private members _count and _time. count and time properties would only be updated when _count % windowSize === 0.

@Pessimistress this should support the usage you need for Deck without _onMetrics.

Bench: Disable calibration tests?

I'm noticing that my first test that is benchmarked is slower than the rest because of the calibration tests (my assumption). Is there a way to disable this?

API Docs can’t be navigated in Safari

The headings (“Get Started”, “Articles”, "API Reference”) in your documentation site cannot be navigated in Safari (11.1.2 (13605.3.8), or Technology Preview Release 63 (Safari 12.1, WebKit 13607.1.2.1)). Instead, you’re navigated back to the overview.

Deprecate log message function syntax in favor of concatenation of params

using inline functions for conditional logging take 2-3x more time than unconditionally building strings.

Looks like the function parameter style does not provide the intended performance benefits, see visgl/deck.gl#3949

Proposals:

  • modify the various log calls to take multiple string segment as parameters and concat them inside the log functions when logging actually happens. That should create no objects and parameter passing is really fast in modern JS engines.
  • consider dropping the function parameter feature from probe if it does not provide expected performance benefits (throw or warn if function parameter is passed).
log.info(() => `releasing ${id}`) // old, expensive inline function with variable capture
log.info(`releasing `, id) // new, fast parameter passing, string concatenation happens only of logging enabled.

Conditional import of `asciify-image` is not compatible with vite.js

The code added for #34 is not compatible with vite.js:

/** Use the asciify module to log an image under node.js */
function logImageInNode({image, message = '', scale = 1}) {
// Note: Runtime load of the "asciify-image" module, avoids including in browser bundles
let asciify = null;
try {
asciify = module.require('asciify-image');
} catch (error) {
// asciify not installed, silently ignore
}
if (asciify) {
return () =>
asciify(image, {fit: 'box', width: `${Math.round(80 * scale)}%`}).then(data =>
console.log(data)
);
}
return noop;
}

The problem is that vite will move all imports to the top of the file, so it's moved outside of the try/catch block.
While this is probably also a bug in vite.js, it's also a bit questionable to depend on the behaviour of other bundlers.

We require a workaround described in visgl/deck.gl#6134 (comment).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.