Re: [PerformanceTimeline] API/WebIDL related feedback

> I'm not sure I see the benefit of the getEntriesByType and 
> getEntriesByName methods since what they do can be done very easily in JS:
>
>   var fooEntries = performance.entries.filter(function(e){return 
> e.name === "foo"}) // ES5
>   var fooEntries = performance.entries.filter(e => e.name === "foo") 
> // ES6

For performance reasons, the browser should be able to generate more 
efficient lists when getEntriesByType() or getEntriesByName() are called 
than you can filter on your own in JavaScript.  Imagine fore example, 
you had 10,000 UserTiming marks and just 10 ResourceTiming entries, and 
just wanted the 10 ResourceTiming entries.  The browser should be able 
to more efficiently generate the list of 10 entries than returning 
10,010 entries and having JavaScript filter the rest.

- Nic
http://nicj.net/
@NicJ

Received on Friday, 23 August 2013 01:26:24 UTC