-
Notifications
You must be signed in to change notification settings - Fork 48
/
607.srt
4229 lines (3103 loc) · 93.2 KB
/
607.srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:00:00.506 --> 00:00:09.496 A:middle
[ Silence ]
00:00:09.996 --> 00:00:10.486 A:middle
>> Simon Fraser: Good morning.
00:00:11.616 --> 00:00:13.516 A:middle
This session is about
Power and Performance,
00:00:14.096 --> 00:00:16.326 A:middle
Optimizing your Websites
for Great Battery Life
00:00:16.326 --> 00:00:17.406 A:middle
and Responsive Scrolling.
00:00:18.136 --> 00:00:19.956 A:middle
I'm Simon Fraser
and I'm Engineer
00:00:19.956 --> 00:00:23.306 A:middle
on the Safari and WebKit Team.
00:00:23.506 --> 00:00:27.116 A:middle
So as you've heard about all
week, one of our primary goals
00:00:27.766 --> 00:00:32.406 A:middle
with OS X Mavericks was to
get great power efficiency
00:00:32.926 --> 00:00:36.186 A:middle
but still maintain and even
improve responsiveness.
00:00:36.506 --> 00:00:41.226 A:middle
So through all the levels of the
operating system we've optimized
00:00:41.506 --> 00:00:44.126 A:middle
for fast performance
and long battery life.
00:00:44.586 --> 00:00:46.956 A:middle
And we know that battery life
is really important to you
00:00:47.206 --> 00:00:48.696 A:middle
because we all use
MacBook's every day
00:00:48.696 --> 00:00:50.416 A:middle
and you really want
that all day battery.
00:00:50.936 --> 00:00:53.646 A:middle
And we also know that you spend
a lot of time browsing the web
00:00:54.416 --> 00:00:57.296 A:middle
so you want a web browser
that's super power efficient and
00:00:57.296 --> 00:00:59.586 A:middle
yet still feels fast
and responsive.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:01:00.106 --> 00:01:03.006 A:middle
But that's not an easy
thing for a web browser.
00:01:03.906 --> 00:01:05.756 A:middle
Web browsers have to
load complex pages.
00:01:06.206 --> 00:01:08.446 A:middle
Those pages contain scripts
that have to be executed.
00:01:08.656 --> 00:01:10.016 A:middle
They load plugins and so on.
00:01:10.586 --> 00:01:13.046 A:middle
So this is quite a challenge
but this is a challenge
00:01:13.046 --> 00:01:17.026 A:middle
that we've met head on in Safari
7 so we have a great new set
00:01:17.026 --> 00:01:18.386 A:middle
of features in Safari 7
00:01:18.656 --> 00:01:20.336 A:middle
that give us much
better power efficiency.
00:01:20.846 --> 00:01:24.096 A:middle
But we also need your help.
00:01:24.686 --> 00:01:28.466 A:middle
In many ways we can only be as
power efficient as the web pages
00:01:28.466 --> 00:01:31.956 A:middle
that we load and display so
we need your help to make sure
00:01:31.956 --> 00:01:33.386 A:middle
that your pages are
power efficient
00:01:33.386 --> 00:01:34.776 A:middle
and that they also play well
00:01:34.776 --> 00:01:36.566 A:middle
with Safari's new
power saving features.
00:01:36.846 --> 00:01:41.336 A:middle
So I'll be talking about
that later on in the session.
00:01:41.466 --> 00:01:43.926 A:middle
So there are three main
sections in this talk today.
00:01:44.606 --> 00:01:47.126 A:middle
First of all I'll talk about
the new power saving features
00:01:47.126 --> 00:01:47.706 A:middle
in Safari.
00:01:48.886 --> 00:01:51.806 A:middle
Secondly I'll talk about how
you can make power efficient web
00:01:51.806 --> 00:01:55.816 A:middle
pages, some new web API you
can use, the tools you use
00:01:55.816 --> 00:01:57.986 A:middle
to detect whether your page
is using too much power
00:01:57.986 --> 00:02:01.216 A:middle
and also some common mistakes
that we've seen pages make
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:01:57.986 --> 00:02:01.216 A:middle
and also some common mistakes
that we've seen pages make
00:02:01.456 --> 00:02:03.886 A:middle
that cause them to use too much
power than the author intended.
00:02:04.386 --> 00:02:07.576 A:middle
And finally I'll talk
about Safari's new response
00:02:07.576 --> 00:02:10.216 A:middle
to scrolling which will give
your users a buttery smooth
00:02:10.216 --> 00:02:13.186 A:middle
scrolling experience on your web
pages and how you can make sure
00:02:13.186 --> 00:02:14.836 A:middle
that your pages get
that best scrolling.
00:02:15.276 --> 00:02:18.266 A:middle
So let me start by talking
00:02:18.266 --> 00:02:20.906 A:middle
about these new power
saving features in Safari.
00:02:21.016 --> 00:02:24.106 A:middle
And there are two features that
I want to talk about today.
00:02:25.136 --> 00:02:27.386 A:middle
The first one is called
App Nap for Safari tabs
00:02:27.916 --> 00:02:30.286 A:middle
and the second one is
called Power Saver.
00:02:32.796 --> 00:02:34.136 A:middle
So if you were in any
00:02:34.136 --> 00:02:36.766 A:middle
of the energy related
sessions yesterday you'll know
00:02:36.766 --> 00:02:40.136 A:middle
that there's a new feature in
OS X Mavericks called App Nap.
00:02:41.316 --> 00:02:44.066 A:middle
Now the purpose of App Nap
is to focus system recourses
00:02:44.356 --> 00:02:46.346 A:middle
on the task that's most
important to the user.
00:02:46.346 --> 00:02:49.706 A:middle
So what we've done is
we've applied App Nap
00:02:49.706 --> 00:02:50.786 A:middle
to tabs in Safari.
00:02:51.196 --> 00:02:53.576 A:middle
And this means we can
Nap background tabs
00:02:53.606 --> 00:02:57.326 A:middle
and that saves us
a lot of power.
00:02:57.506 --> 00:02:58.306 A:middle
So how does this work?
00:02:58.536 --> 00:03:00.016 A:middle
Well you may already know
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:02:58.536 --> 00:03:00.016 A:middle
Well you may already know
00:03:00.016 --> 00:03:03.056 A:middle
that in Safari we actually use
a separate process for loading
00:03:03.056 --> 00:03:04.166 A:middle
and rendering the web page
00:03:04.166 --> 00:03:06.276 A:middle
and we call this the
Web Content Process.
00:03:07.186 --> 00:03:11.696 A:middle
New in Safari 7 now, each tab
has its own web content process
00:03:12.116 --> 00:03:13.266 A:middle
and that means that the pages
00:03:13.266 --> 00:03:15.896 A:middle
in different tabs are mostly
isolated from each other.
00:03:17.096 --> 00:03:19.616 A:middle
But it also means that
we can now apply App Nap
00:03:20.166 --> 00:03:22.326 A:middle
to the processes for
each tab independently
00:03:22.446 --> 00:03:26.606 A:middle
and of course now we can do
that, we can Nap background tabs
00:03:26.836 --> 00:03:29.526 A:middle
and this allows Safari to
focus all its resources
00:03:29.526 --> 00:03:30.946 A:middle
on the tab you're
working with right there
00:03:30.946 --> 00:03:32.156 A:middle
which makes it really
responsive.
00:03:32.156 --> 00:03:36.236 A:middle
So when can we do
this napping of tabs?
00:03:36.566 --> 00:03:38.216 A:middle
Well in general we'll
Nap any tab
00:03:38.216 --> 00:03:40.116 A:middle
that the user can't
currently see
00:03:40.446 --> 00:03:43.776 A:middle
so that means background tabs,
tabs that minimize windows
00:03:43.776 --> 00:03:46.206 A:middle
on another space or with the
screen servers on covering
00:03:46.206 --> 00:03:48.236 A:middle
up Safari and in
general any window
00:03:48.236 --> 00:03:49.966 A:middle
which is what we call
occluded which just means
00:03:49.966 --> 00:03:51.376 A:middle
that it's covered
up by something else
00:03:51.376 --> 00:03:52.756 A:middle
and the user can't see it.
00:03:53.226 --> 00:03:57.206 A:middle
And there's one other
case where we can Nap tabs
00:03:57.506 --> 00:03:59.576 A:middle
and that's what we
call idle windows.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:04:00.716 --> 00:04:03.976 A:middle
So the system can now tell
us whether a window has been
00:04:03.976 --> 00:04:04.906 A:middle
updated recently.
00:04:05.546 --> 00:04:08.476 A:middle
And if it hasn't then
we can apply App Nap
00:04:08.476 --> 00:04:11.946 A:middle
to that web process which means
that if a web page is loaded,
00:04:11.946 --> 00:04:14.646 A:middle
maybe it's in the background,
and you can kind of see part
00:04:14.646 --> 00:04:16.086 A:middle
of the window but
it's not actually,
00:04:16.086 --> 00:04:17.606 A:middle
the page is not really
doing anything.
00:04:17.805 --> 00:04:20.736 A:middle
That means that page is
also eligible for napping.
00:04:23.776 --> 00:04:27.226 A:middle
So what is the impact on your
web page of being in a tab
00:04:27.226 --> 00:04:29.436 A:middle
that has been App Napped?
00:04:29.886 --> 00:04:31.266 A:middle
Well if you were in any
00:04:31.266 --> 00:04:33.496 A:middle
of the energy related
sessions you'll know that one
00:04:33.496 --> 00:04:36.186 A:middle
of the worst things for power
efficiency is the firing
00:04:36.186 --> 00:04:36.926 A:middle
of timers.
00:04:37.676 --> 00:04:40.086 A:middle
Every time a timer fires
the system has to wake up,
00:04:40.396 --> 00:04:42.236 A:middle
the CPU has to ramp up
from a low power mode
00:04:42.236 --> 00:04:44.516 A:middle
to a how power mode and
all this is very wasteful.
00:04:44.936 --> 00:04:47.766 A:middle
So one of the best ways
that we can save power is
00:04:47.766 --> 00:04:50.276 A:middle
to rate limit the JavaScript
timers and those are setTimeout
00:04:50.276 --> 00:04:51.526 A:middle
and setInterval in JavaScript.
00:04:52.156 --> 00:04:56.526 A:middle
If you're using
requestAnimationFrame,
00:04:56.526 --> 00:04:58.306 A:middle
which I'll talk about a bit
later on in the session,
00:04:58.496 --> 00:04:59.776 A:middle
that will also get rate limited.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:05:00.886 --> 00:05:04.746 A:middle
But when we were working on
this we found a couple cases
00:05:04.746 --> 00:05:08.646 A:middle
where tabs in the background
are actually doing useful work
00:05:08.646 --> 00:05:09.996 A:middle
or things that you
want to continue.
00:05:09.996 --> 00:05:12.116 A:middle
For example there are
some audio players
00:05:12.466 --> 00:05:15.576 A:middle
that you know periodically
load data dynamically
00:05:15.576 --> 00:05:19.436 A:middle
as they're running and that's
something you want to continue
00:05:19.436 --> 00:05:20.756 A:middle
to work because you
want that audio
00:05:20.756 --> 00:05:22.296 A:middle
to keep playing audio
in the background.
00:05:22.296 --> 00:05:24.986 A:middle
So we actually detect that and
we don't Nap tabs in that case.
00:05:25.296 --> 00:05:28.186 A:middle
And if tabs are also dynamically
loaded content we won't
00:05:28.686 --> 00:05:31.286 A:middle
Nap them.
00:05:31.566 --> 00:05:32.836 A:middle
So what should you
do to make sure
00:05:32.836 --> 00:05:36.766 A:middle
that your web pages play nicely
with App Nap for Safari Tabs?
00:05:37.596 --> 00:05:38.506 A:middle
Well in general, nothing.
00:05:38.506 --> 00:05:40.396 A:middle
We hope this will just
work very transparently.
00:05:40.816 --> 00:05:41.756 A:middle
But you should be aware
00:05:42.036 --> 00:05:43.846 A:middle
that your timers
could be rate-limited.
00:05:44.426 --> 00:05:49.576 A:middle
So that's App Nap
for Safari Tabs.
00:05:50.206 --> 00:05:51.246 A:middle
We think this is
going to be great
00:05:51.246 --> 00:05:54.046 A:middle
for people we call tab
holders, the kinds of people
00:05:54.046 --> 00:05:56.136 A:middle
who have lots of tabs
open and lots of windows.
00:05:56.906 --> 00:05:59.116 A:middle
Those kinds of people should
really investigate Safari
00:05:59.116 --> 00:06:00.956 A:middle
Reading Lists because that's a
much better way of keeping track
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:05:59.116 --> 00:06:00.956 A:middle
Reading Lists because that's a
much better way of keeping track
00:06:00.956 --> 00:06:01.846 A:middle
of all of those URL's.
00:06:01.846 --> 00:06:03.646 A:middle
But if you do have lots
of windows and lots
00:06:03.646 --> 00:06:07.546 A:middle
of tabs open now, Safari is able
to Nap all those background tabs
00:06:07.796 --> 00:06:09.796 A:middle
which means that it's
really focusing resources
00:06:09.796 --> 00:06:11.186 A:middle
on the tab you're
currently working with
00:06:11.186 --> 00:06:13.176 A:middle
and that makes you feel
much more responsive.
00:06:13.846 --> 00:06:16.676 A:middle
So the second new
feature I want to talk
00:06:16.676 --> 00:06:19.076 A:middle
about today is called
Safari Power Saver.
00:06:19.076 --> 00:06:21.766 A:middle
One of the things we found
00:06:22.276 --> 00:06:24.556 A:middle
when we were investigating
power usage in Safari,
00:06:24.556 --> 00:06:26.206 A:middle
and this didn't really
surprise us,
00:06:26.556 --> 00:06:28.966 A:middle
is that plugins use an
enormous amount of power.
00:06:29.526 --> 00:06:32.786 A:middle
And this is a problem we
didn't have to solve in iOS.
00:06:33.136 --> 00:06:36.526 A:middle
Now in OS X we could have
simply stopped running plugins
00:06:36.796 --> 00:06:38.006 A:middle
but the problem is
that would result
00:06:38.006 --> 00:06:39.376 A:middle
in a broken user experience.
00:06:39.726 --> 00:06:42.226 A:middle
Many people visit a page and not
really understand why it didn't
00:06:42.226 --> 00:06:44.146 A:middle
work the way it used to
because the plugins not running.
00:06:44.696 --> 00:06:46.606 A:middle
So we had to fix this in a way
00:06:46.606 --> 00:06:48.406 A:middle
that was a bit smarter
than that.
00:06:48.756 --> 00:06:50.986 A:middle
And we came up with something
that we call Power Saver.
00:06:51.896 --> 00:06:55.776 A:middle
This gave us, the impact of
turning on Power Saver we got an
00:06:55.776 --> 00:06:58.426 A:middle
up to 35% reduction in
CPU power consumption
00:06:58.776 --> 00:07:00.296 A:middle
so it's really great
energy saving.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:06:58.776 --> 00:07:00.296 A:middle
so it's really great
energy saving.
00:07:00.836 --> 00:07:05.336 A:middle
So you know why do
we need this thing?
00:07:05.336 --> 00:07:07.586 A:middle
Well this is typical of the
web pages you visit every day,
00:07:07.586 --> 00:07:09.336 A:middle
like a typical news
site or a blog site.
00:07:09.336 --> 00:07:11.916 A:middle
And one of the things you
may not really pay attention
00:07:11.916 --> 00:07:14.376 A:middle
to is all the marginal content,
all the peripheral content
00:07:14.566 --> 00:07:16.676 A:middle
which you don't really care
about, often it's adds.
00:07:16.676 --> 00:07:18.606 A:middle
But what you may not
realize is how much
00:07:18.606 --> 00:07:21.016 A:middle
of this content is actually
running through plugins.
00:07:21.786 --> 00:07:25.286 A:middle
So without Power Saver these
plugins are running all the time
00:07:25.496 --> 00:07:28.996 A:middle
and that is, of course, causing
the CPU to be busy all the time.
00:07:28.996 --> 00:07:30.836 A:middle
The CPU is always active.
00:07:31.216 --> 00:07:32.066 A:middle
It gets warm.
00:07:32.066 --> 00:07:33.036 A:middle
The fans come on.
00:07:33.036 --> 00:07:35.026 A:middle
And of course that's all
really bad for battery life.
00:07:35.566 --> 00:07:39.946 A:middle
Now that we can pause these
plugins the CPU usage is much
00:07:39.946 --> 00:07:45.406 A:middle
lower and it has a really
positive impact on battery life.
00:07:45.996 --> 00:07:47.526 A:middle
So I said before,
we do this in a way
00:07:47.526 --> 00:07:49.026 A:middle
that most users won't notice.
00:07:49.026 --> 00:07:49.786 A:middle
It's unobtrusive.
00:07:49.786 --> 00:07:51.746 A:middle
So we call it Smart
Power Saving.
00:07:52.286 --> 00:07:57.396 A:middle
And generally the way we do this
is through three techniques.
00:07:58.216 --> 00:08:01.086 A:middle
First of all when you visit
a page in order to see
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:07:58.216 --> 00:08:01.086 A:middle
First of all when you visit
a page in order to see
00:08:01.086 --> 00:08:02.596 A:middle
like an internet
video or something,
00:08:02.596 --> 00:08:04.136 A:middle
some plugin is up
front and center.
00:08:04.516 --> 00:08:06.366 A:middle
We'll just continue to run
that because you probably went
00:08:06.366 --> 00:08:07.756 A:middle
to that page to see
that thing anyway.
00:08:08.256 --> 00:08:10.676 A:middle
So that we call a primary
plugin and we'll just run.
00:08:11.956 --> 00:08:15.716 A:middle
Secondly, plugins are often used
for things like playing audio
00:08:15.896 --> 00:08:17.936 A:middle
and those plugins might
be like really small
00:08:17.936 --> 00:08:19.356 A:middle
or positioned somewhere
else on the page
00:08:19.676 --> 00:08:21.286 A:middle
and we'll just let
those continue to run.
00:08:21.996 --> 00:08:26.746 A:middle
And finally if the user
interacts with a plugin
00:08:26.746 --> 00:08:29.306 A:middle
on the page we'll remember
the fact that they clicked
00:08:29.306 --> 00:08:32.696 A:middle
that plugin on the page and next
time they visit we'll just start
00:08:32.696 --> 00:08:33.756 A:middle
that plugin automatically.
00:08:36.046 --> 00:08:38.186 A:middle
So what's Power Saver
doing under the hood?
00:08:38.416 --> 00:08:42.866 A:middle
Well when a page loads we
let the plugins run but just
00:08:42.866 --> 00:08:45.026 A:middle
for a short time
and we let them run
00:08:45.026 --> 00:08:47.476 A:middle
until they've given us a
useful snatch of their contents
00:08:47.616 --> 00:08:49.626 A:middle
and then we actually
replace the plugin
00:08:49.626 --> 00:08:50.906 A:middle
in the page with that snapshot.
00:08:51.416 --> 00:08:56.236 A:middle
And then if the user clicks
the snapshot we'll go ahead
00:08:56.236 --> 00:08:58.796 A:middle
and recreate the plugin, we'll
pass that click event through
00:08:58.796 --> 00:09:00.166 A:middle
and then the plugin
we'll run as normal.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:08:58.796 --> 00:09:00.166 A:middle
and then the plugin
we'll run as normal.
00:09:00.166 --> 00:09:02.346 A:middle
And in many cases the
user won't even notice.
00:09:02.856 --> 00:09:07.556 A:middle
When we do pause plugins, if the
user happens to hover over one
00:09:07.556 --> 00:09:09.916 A:middle
of those plugins, Safari
will put up this banner
00:09:09.916 --> 00:09:12.116 A:middle
that just indicates that it's
done something to that plugin
00:09:12.326 --> 00:09:14.356 A:middle
but the user can just go ahead
and click anywhere on the plugin
00:09:14.446 --> 00:09:15.716 A:middle
and the plugin will
start running.
00:09:18.356 --> 00:09:21.236 A:middle
So what should you do to make
sure that your pages play nicely
00:09:21.236 --> 00:09:22.206 A:middle
with Safari Power Saver?
00:09:22.526 --> 00:09:25.176 A:middle
Well of course the most obvious
thing is to use fewer plugins.
00:09:25.456 --> 00:09:28.346 A:middle
If you can use one of the
great HTML 5 technologies
00:09:28.346 --> 00:09:33.766 A:middle
like the audio and video
elements or Canvas or Web Audio
00:09:33.766 --> 00:09:37.236 A:middle
or SPG or any of those for
rich media presentations,
00:09:37.856 --> 00:09:38.676 A:middle
those are always going
00:09:38.676 --> 00:09:40.346 A:middle
to be more power
efficient then a plugin
00:09:40.416 --> 00:09:41.936 A:middle
because we've optimized
those really heavily.
00:09:42.476 --> 00:09:46.646 A:middle
We have seen a few cases
where pages that communicate
00:09:46.646 --> 00:09:49.216 A:middle
with a plugin through
script have had problems.
00:09:49.586 --> 00:09:53.076 A:middle
And generally in these cases
the page is not prepared
00:09:53.076 --> 00:09:56.436 A:middle
to handle the fact that there
may be more than one instance
00:09:56.436 --> 00:09:58.556 A:middle
of a plugin for a given
object or embed element
00:09:58.556 --> 00:09:59.966 A:middle
over the lifetime of the page.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:10:00.436 --> 00:10:02.296 A:middle
So the page needs to
be prepared for plugins
00:10:02.296 --> 00:10:03.636 A:middle
to be destroyed and recreated.
00:10:04.016 --> 00:10:05.946 A:middle
And generally what this means is
00:10:05.946 --> 00:10:08.966 A:middle
that the plugin should
request state for the page
00:10:08.966 --> 00:10:11.566 A:middle
when it starts up, rather
than the page pushing state
00:10:11.566 --> 00:10:17.296 A:middle
down to the plugin and
expecting that to persist.
00:10:17.296 --> 00:10:18.466 A:middle
So that's Safari Power Saver.
00:10:19.196 --> 00:10:21.966 A:middle
And it gives us a really great
energy saving and we hope
00:10:21.966 --> 00:10:27.276 A:middle
that most of users will not
even notice that it's there.
00:10:27.696 --> 00:10:29.946 A:middle
So I talked about these two
new features in Safari 7
00:10:29.946 --> 00:10:32.056 A:middle
that combined give us
really great power savings.
00:10:32.276 --> 00:10:33.686 A:middle
But we also need your help.
00:10:34.636 --> 00:10:35.946 A:middle
We need you to make sure
00:10:35.946 --> 00:10:40.106 A:middle
that your pages are really power
efficient and we need to do this
00:10:40.106 --> 00:10:43.546 A:middle
because we can't just have
Safari do power saving things
00:10:43.546 --> 00:10:44.866 A:middle
that break the way pages work.
00:10:45.516 --> 00:10:47.776 A:middle
So I'll tell you about how
00:10:47.776 --> 00:10:49.246 A:middle
to make power efficient
web pages now.
00:10:50.046 --> 00:10:52.506 A:middle
Firstly we've got a couple
new pieces of web API
00:10:53.046 --> 00:10:55.116 A:middle
which you can use to make
sure your pages save power.
00:10:56.436 --> 00:10:58.736 A:middle
Secondly I'll talk about
the tools you can use
00:10:58.736 --> 00:11:00.676 A:middle
to detect whether your
pages are using more power
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:10:58.736 --> 00:11:00.676 A:middle
to detect whether your
pages are using more power
00:11:00.676 --> 00:11:01.346 A:middle
than they should.
00:11:01.996 --> 00:11:04.436 A:middle
And finally I'll talk about some
common mistakes we have seen
00:11:04.776 --> 00:11:09.096 A:middle
that really is a pitfall
that some pages fall
00:11:09.096 --> 00:11:12.086 A:middle
into that cause them to
use a lot more power.
00:11:13.076 --> 00:11:18.246 A:middle
So first the new web API, now
there are two of these I'd
00:11:18.246 --> 00:11:20.556 A:middle