Skip to content

general solutions for realtime js performance #42

Description

@hellochar

Problem: too much js computation per frame makes things slow. We want to adapt our computation across different cpu speeds.

Detecting performance:

  1. don't detect; let user decide perf
  2. do a stress test when user first loads page
    • save quality in localStorage
  3. realtime monitor framerate

Perf data modelling:

  1. "low" | "medium" | "high"
  2. "perf" slider number between 0-1 that represents how "fast" this machine goes
  3. two numbers - "cpu" speed and "gpu" speed.
  4. separate properties for: texture size, cpu speed, gpu speed, sfx on/off, etc.

How sketches actually implement quality:

  1. each sketch handles quality separately (e.g. through if/else checks), just looks it up from a service
    • need sketches to adapt to changing quality values
  2. we provide a few APIs to make doing quality easier:
    • "tunable number" - e.g. number of points in the particle system; write common logic to handle changing this number to adapt to the performance
    • "job queue" - common API to break up all the computation into specific, 16ms-at-a-time portions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions