Closed Bug 557870 Opened 12 years ago Closed 9 years ago

HTMLMediaElement.currentTime is not quickstubbed

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 841493

People

(Reporter: danguafer, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.2) Gecko/20100115 Firefox/3.6

Many native objects presents this same problem.
Example:
Reading/writing in HTMLAudioElement's currentTime is slow.

Reproducible: Always

Steps to Reproduce:
var audio = new Audio();
var start = new Date().getTime();
for (var i=0; i < 500000; i++)
	var whatever = audio.currentTime;
alert(new Date().getTime()-start);
Actual Results:  
Too slow

Expected Results:  
Same speed as accessing any other javascript object property.

Consider testing it in Google Chrome. Its access speed is like accessing any
other regular variable/property. I think this behavior should be the expected
one.
A couple of notes:

1)  It's trivial to make access to this property for the simple case here (which doesn't actually get a current time of any sort, just measures the call overhead) as fast as chrome or faster.

2)  Doing that involves using more memory and having a bigger download size for the browser.  This is the approach Chrome takes, in fact.  It means they win on silly microbenchmarks but often lose on larger-scale code where the extra codesize leads to instruction cache misses and the like.

3)  Filing bugs like "all properties are slow" is not useful, since they're slow for different reasons.

I'll put up a patch for item 1; I'm just not entirely convinced it's useful, since in practice getting currentTime will involve some nontrivial amount of time actually ... getting the current time.  If there were a testcase that showed that this is not a problem (in that the overhead dominates the actual getter), then quickstubbing this is warranted.
Status: UNCONFIRMED → NEW
Component: General → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → general
Summary: Native objects properties accesses are too slow → HTMLAudioElement.currentTime is not quickstubbed
Summary: HTMLAudioElement.currentTime is not quickstubbed → HTMLMediaElement.currentTime is not quickstubbed
I know something better...
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 841493
You need to log in before you can comment on or make changes to this bug.