1
00:00:02,570 --> 00:00:04,250
And with that we're done,

2
00:00:04,250 --> 00:00:06,980
now let me briefly sum up what we learned

3
00:00:07,010 --> 00:00:12,030
We had a look at runtime performance and potential improvements we can implement there.

4
00:00:12,320 --> 00:00:20,150
You should avoid unnecessary code executions, batch operations together and avoid unnecessary DOM

5
00:00:20,270 --> 00:00:22,670
access as you learned. You should

6
00:00:22,670 --> 00:00:28,940
of course also find and fix memory leaks, even small ones because they can add up and make your page

7
00:00:28,970 --> 00:00:33,620
slower or make it crash. For high frequency operations,

8
00:00:33,620 --> 00:00:40,310
you can compare different approaches, like the two for loop alternatives

9
00:00:40,310 --> 00:00:43,460
we had a look at and use the faster one

10
00:00:43,460 --> 00:00:50,900
and in general you might consider micro optimizations but you should also be careful about them because

11
00:00:50,900 --> 00:00:57,740
performance isn't a fixed thing, it can change in the future and you might be optimizing for something

12
00:00:57,740 --> 00:01:02,680
which really doesn't matter. When we have a look at startup performance,

13
00:01:02,780 --> 00:01:09,920
then we want to eliminate unnecessary or unused code, to download as small of a code package initially

14
00:01:09,920 --> 00:01:11,410
as possible.

15
00:01:11,420 --> 00:01:17,350
You also want to avoid using too many third-party libraries for that reason because every third-party

16
00:01:17,370 --> 00:01:23,990
library you add is extra code which needs to be downloaded and parsed, so the more third-party libraries

17
00:01:23,990 --> 00:01:30,980
you load, the more code you have to download. If you use third-party libraries, you also want to consider

18
00:01:31,040 --> 00:01:37,040
importing them into your script files and then using webpack for bundling and code splitting instead

19
00:01:37,040 --> 00:01:42,980
of using CDN links because if you use CDN links, you can't use code splitting.

20
00:01:43,040 --> 00:01:49,100
So bundling code and using lazy loading here really is a great idea for ensuring that your code starts

21
00:01:49,100 --> 00:01:53,510
fast and is able to execute as early as possible.

22
00:01:53,540 --> 00:01:54,210
Of course you should

23
00:01:54,200 --> 00:02:00,380
also minify code and webpack does this automatically to ensure that you ship as little code as possible

24
00:02:00,380 --> 00:02:02,450
to your end users

25
00:02:02,810 --> 00:02:04,210
and this is really it.

26
00:02:04,250 --> 00:02:06,680
You saw a lot of examples throughout this module,

27
00:02:06,680 --> 00:02:12,510
i hopefully could introduce you to how you should think about performance optimizations.

28
00:02:12,620 --> 00:02:19,580
You also got some useful external resources where you can dive deeper and in general, performance optimization

29
00:02:19,580 --> 00:02:22,820
is a topic which you can't really master,

30
00:02:22,940 --> 00:02:24,690
it's an ongoing journey,

31
00:02:24,710 --> 00:02:30,090
there are always new things to explore and it's also very specific to your exact use case.

32
00:02:30,140 --> 00:02:35,180
It's always very specific to that regarding what you want to look into and what you might want to consider

33
00:02:35,240 --> 00:02:36,740
optimizing.

34
00:02:36,740 --> 00:02:43,850
You can also google for Javascript performance optimizations and you will find many examples, some

35
00:02:43,850 --> 00:02:47,000
which you already saw here, some which you didn't.

36
00:02:47,000 --> 00:02:53,240
This can also be interesting to learn more about this topic but always also keep in mind that you shouldn't

37
00:02:53,360 --> 00:02:54,110
overdo it,

38
00:02:54,110 --> 00:03:01,070
you want to improve your application, you want to fix bugs and leaks but you don't want optimize every

39
00:03:01,070 --> 00:03:07,070
tiny bit because you could end up with code which is actually longer than before and therefore adds

40
00:03:07,070 --> 00:03:14,390
to the bundle size or you implemented an optimization which isn't optimal anymore in the future.

41
00:03:14,420 --> 00:03:19,700
Still, this hopefully got you started and i showed you some of the most important and critical aspects

42
00:03:20,000 --> 00:03:24,030
when it comes to performance optimizations and what you should keep in mind

43
00:03:24,040 --> 00:03:24,290
there.
