Project

General

Profile

Actions

Patch #32523

closed

Replace `for` loops with `forEach` in buildFilterRow function

Added by Stéphane Parunakian almost 5 years ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi,

When building a query on the /issues page, if you use a filter on users (assigned to, author, etc.) and you have a lot of them, the browser freezes for a few moments. This can be improved by slightly modifying the JavaScript running on the page.

In the public/javascripts/application.js, a lot of "for" loops use var.length in their statements, which is evaluated at each loop.

The attached patch adds, for each loop, a var assignment just before the loop, which is used in the statement.

Performances are greatly improved on Firefox and Chromium.

Regards


Files

javascript-perf.diff (1.85 KB) javascript-perf.diff Stéphane Parunakian, 2019-11-27 16:49
javascript-perf2.diff (1.85 KB) javascript-perf2.diff Stéphane Parunakian, 2019-11-29 10:56
execution_speed_measurement.png (223 KB) execution_speed_measurement.png Yuichi HARADA, 2019-12-10 04:14
32523-note-2.patch (2.51 KB) 32523-note-2.patch Go MAEDA, 2024-09-05 12:21
32523-v3.patch (2.57 KB) 32523-v3.patch Yuichi HARADA, 2024-09-12 04:47
Actions

Also available in: Atom PDF