Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose CPU clock speed and GPU info in the same manner as device memory #15

Open
n8schloss opened this issue Oct 26, 2017 · 3 comments
Open

Comments

@n8schloss
Copy link

Posting this here because I figure if we do this we'd want to just expand the current device memory spec, but happy to move this conversation elsewhere if we think that'd be better.

The issue

Getting device memory was a big step in the right direction for us! It'll allow us to stop shipping heavy JS to clients that cannot handle it.

However, there are still cases where a device might have enough memory but would be CPU constrained and we would end up shipping a CPU-intensive function when we could have served a lighter version.

Similarly, memory info isn't enough to know whether we should ship something that might be GPU-intensive. Right now, we can get basic information about the GPU by spinning up a WebGL context and asking for the WEBGL_debug_renderer_info, but on older devices, spinning up a WebGL context can be expensive and cause the page to freeze for several seconds.

Finally, while knowing memory info is good, we need to know the CPU clock speed and GPU info to help us paint the full picture of what the critical path looks like across various device types and how the device performs on different hardware tiers.

The solution

For CPU information, we can expose the CPU clock speed in the same way that we expose device memory (with some level of fuzzing). Clock speed, device memory and hardwareConcurrency are enough to paint a full picture about the device's processing capabilities.

For the GPU info, let's expose the same info that WEBGL_debug_renderer_info already exposes but not require a WebGL context to get spun up.

Privacy/Security

For GPU info, there are no new big security or privacy issues to think through. We'd be exposing info that's already available but in a more performant way.

For CPU info we can do some level of fuzzing to help things here.

What about ARM's big.LITTLE?

ARM's big.LITTLE architecture allows the CPU to have two different clock speeds and to switch between them based on current usage. Maybe to start, we expose the frequency info for the CPU that's currently in use and post an event if the configuration changes? Happy to discuss this more, I'm not sure if I know enough about this.

@igrigorik igrigorik added this to the Level 1 milestone May 25, 2018
@yoavweiss
Copy link
Contributor

@n8schloss - This seems more like a proposal for a new feature rather than an extension to Device Memory (unless we expand its scope and rename).

Are you interested in leading a short discussion on that at the upcoming F2F?

@n8schloss
Copy link
Author

@yoavweiss, this doesn't seem to have picked up steam so I'm not sure if it's worth it to bring this up again. Happy to talk about it if we have extra time, but I would keep this as a low pri item on the schedule.

@yoavweiss
Copy link
Contributor

Changing to level 2, as this doesn't seem blocking

@yoavweiss yoavweiss modified the milestones: Level 1, Level 2 Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants