Профилирование кода JavaScript

Цена договорная • безналичный расчёт, электронные деньги
18 ноября 2018, 15:14 • 2 отклика • 80 просмотров
Задание в университете по тестированию -

https://github.com/rugk/offline-qr-code - код проекта

In this exercise we will focus on profiling. Generally, profiling is a form of dynamic analysis (i.e., program runtime) that measures selected program properties, usually for the purpose of improving them. The most common types of profiling are:

time,

memory,

network,

energy, battery, ...


Choose one type of profile and run "profiler" when performing a certain scenario. This scenario should ideally be automated, so it should be done several times with the same result, approximate execution time, etc. The best one can serve unit tests. However, it is also possible to manually perform some activity in the UI.

In the profiling results you can try to find a "bottleneck", a part of the code that causes the biggest problems - consumes a lot of time, memory, energy, and the like. Focus on the selected part of the code and try to modify it so that it changes to a better one - reduce execution time. Measure and mark the values of the metric before and after this change. Be careful that the measurement is accurate - e.g. the method that is carried out by a couple of nanoseconds is to be done a series of times.


Finding "bottleneck": 2 points

Measuring the metric value before and after changing the code: 2 points

if the code change improves the metric: max. 3 points