- From: Nic Jansma <nic@nicj.net>
- Date: Thu, 22 Aug 2013 21:26:04 -0400
- To: David Bruant <bruant.d@gmail.com>
- CC: James Simonsen <simonjam@google.com>, Boris Zbarsky <bzbarsky@mit.edu>, public-web-perf <public-web-perf@w3.org>
> 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