PerfMeter icon indicating copy to clipboard operation
PerfMeter copied to clipboard

Gather interesting metrics

Open spite opened this issue 9 years ago • 6 comments

Supported right now

Per frame:

  • Framerate (frames drawn over a second)
  • Frame time (JavaScript time spent in rAFs execution)
  • Number of rAFs

CanvasRenderingContext2D:

  • JavaScript time spent on canvas methods
  • Canvas methods calls
  • Optional: log of operations with start and end time

WebGLRenderingContext (per frame)

  • JavaScript time spent on canvas methods
  • Canvas methods calls
  • Optional: log of operations with start and end time
  • GPU time
  • Shaders GPU time (not stable yet)
  • useProgram calls, global WebGLProgram count
  • bindTexture calls, global WebGLTexture count
  • bindFramebuffer, global WebGLFramebuffer count
  • drawArrays and drawElement calls
  • points, lines and triangles from drawArrays and drawElements
  • instanced drawArrays and drawElements (via ANGLE_instanced_arrays)
  • points, lines and triangles from instanced drawArrays and drawElements

WebGL2RenderingContext (not yet ported from previous version)

  • Same as WebGLRenderingContext
  • drawArraysInstanced and drawElementsInstanced instead of ANGLE_instanced_arrays
  • points, lines and triangles from drawArraysInstanced and drawElementsInstanced

Browser:

  • Memory: used heap, total heap size

WebGL implementation (via WEBGL_debug_renderer_info):

  • Unmasked vendor
  • Unmasked renderer
  • Version
  • Language version

Proposed

  • Texture upload/copy time
  • Indirectly track GPU memory from upload methods
  • State changes (total, graph)

spite avatar Oct 23 '16 15:10 spite

Texture uploading time?

yomboprime avatar Oct 24 '16 14:10 yomboprime

Good one. I think texImage2D, texSubImage2D, etc. can be profiled with the TimeLine as any JavaScript method. The call log in the extension would make it easier to find specific calls, or all calls related to a specific texture.

spite avatar Oct 24 '16 14:10 spite

state changes see from slides 49 to 55,http://media.steampowered.com/apps/steamdevdays/slides/beyondporting.pdf

Kuranes avatar Oct 24 '16 19:10 Kuranes

@Kuranes good one, too. The visual aid in that presentation would be pretty cool to have, too

spite avatar Oct 24 '16 19:10 spite

This may be off-topic, but how can you tell which shader is which under "Shaders GPU time"? I get a new hash every time. Are they listed in any particular order?

marquizzo avatar Mar 03 '17 21:03 marquizzo

@marquizzo they're added in order they're called (via useProgram) in the frame. the hash identifies each program. you should be seeing the same hashes in more or less the same order. if you're seeing different hashes every time, make sure you're not creating new shaders constantly! :)

spite avatar Mar 03 '17 22:03 spite