WICG / budget-api

Proposal for a Budget API
https://wicg.github.io/budget-api/
Other
26 stars 11 forks source link

[TAG] Uniform Weights Per Operation? #18

Open slightlyoff opened 7 years ago

slightlyoff commented 7 years ago

From TAG feedback issue

@triblondon notes that the model the API presents weights all silent pushes (e.g.) to be equal. Do we have confidence that this will always be true? Has a model been considered in which the developer requests some budget for an operation and is then limited to that budget (e.g., execution time)?

beverloo commented 7 years ago

The getCost() method returns the maximum cost of an operation. The actual cost may be lower depending on device conditions (charging, screen state), network conditions and, as you say, details of executing the actual operation.

The amount of budget withdrawn when reserving or otherwise using it does depend on these conditions, and has a note at the definition of the concept of reserving budget:

https://wicg.github.io/budget-api/#reserve-budget