Join Maximiliano Firtman for an in-depth discussion in this video Detect long tasks, part of Vanilla JavaScript: Web Performance Optimization APIs.
- [Narrator] A recent addition to the…performance family is the Long Task API.…The long task API will let us detect…when we have some code that is taking the thread…for too much time, so it's a long task.…And we should do something different,…such as using a web worker, or changing the algorithm.…That's not available in every browser today.…In fact it's fairly experimental.…So we need to do something similar to paint timing.…
This is the long task API, we also need…an observer in this case, it's mandatory…to have an observer.…We going to create the long task observer.…It's a new performance observer that…we receive a list and we're going to…first try to observe on that observer and in…this case, the entry type is Longtask, one word.…
We need the catch, and we're going…to observe here for now.…We will just get the entries, all of them…and for each entry, we're going to…execute the very simple code that we'll call Perf,…and we'll say Longtask and for the name,…we're going to specify, Thread used for too long.…(mumbles)…
Author
Released
10/30/2018- Understanding the Performance APIs
- Navigation Timing
- Calculate milestones in the Performance Timeline
- Measuring the timing of navigation, resources, servers, and more
- Reading network and device information
- Optimizing code
Skill Level Advanced
Duration
Views
Related Courses
-
Designing Websites for Performance
with Brian Wood43m 32s Appropriate for all
-
Introduction
-
1. Reactive Web Performance
-
Summary of what we can do3m 42s
-
Measure time4m 18s
-
High-resolution timings2m 43s
-
2. Performance Basics
-
Navigation Timing Level 12m 57s
-
Understand timings available5m 23s
-
Navigation Timing Level 23m 48s
-
-
3. Measure Performance
-
Measuring our websites4m 18s
-
Use the Resource Timing API4m 45s
-
Get paint timing4m 31s
-
Detect long tasks3m 44s
-
Detect frame rate drops2m 39s
-
-
4. Decision-Making Helpers
-
Read network information5m 15s
-
Save data for your users1m 36s
-
-
5. Execute Code More Efficiently
-
Execute background tasks3m 12s
-
Efficient script yielding1m 12s
-
Conclusion
-
Next steps1m 31s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Detect long tasks