- Issue created by @mabho
- Merge request !94333472217: Improve Drupal.behaviors.permissions for enhanced performance. β (Open) created by mabho
- π§π·Brazil mabho Rio de Janeiro, RJ
I am introducing some enhancements with the purpose of making the code run faster.
First things first, removing jQuery delivers relevant performance enhancement. It is amazing how slow the code can get on some operations triggered by jQuery. This becomes more dramatic on a script being activate on each keystroke by the client.
Apart from that, the code is also introducing transitional variables storing information on the most recent text typed and sample search results extracted. By comparing the previous search string with the current, the program can determine if the user is incrementally typing a word or phrase. If so, it will incrementally run the new row filtering from the sample results on the previous round, instead of doing it from scratch every time.
This dramatically reduces the number of rows the program needs to analyze, thus improving performance.
A merge request is already available.
- πΊπΈUnited States nicxvan
I'm on my phone so I can't fix this but the tests are not running because there is a typo: beiong
- π§π·Brazil mabho Rio de Janeiro, RJ
Real-time commenting and adjusting ;-) Just fixed the typo, many thanks for the quick feedback!
- Status changed to Needs review
7 months ago 3:41am 6 September 2024 - π«π·France nod_ Lille
for filtering I'd rather look into β¨ Create Javascript library for searching rendered lists on the client. Needs work rather than spend time on each individual filter script
- πΊπΈUnited States nicxvan
Can the change here be used as a base for the shared library?
- π§π·Brazil mabho Rio de Janeiro, RJ
Thank you @_nod and @nicxvan. I can see that initiative is pretty advanced and removes the dependency on jQuery... Maybe the suggested approach here (taking advantage of a subset of the records being searched based on the text previously typed) can be ported into that script for improved performance... or not. I will take a look at it.
- π§π·Brazil mabho Rio de Janeiro, RJ
My only concern about this permissions table is its mechanism to hide/show the parent of the found record (in this case, the module name associated with the found permission). I wonder if the implementation being carried out here (https://git.drupalcode.org/project/drupal/-/merge_requests/6309/diffs#58...) is taking care of this. This is speculation, though, and I need to look into that implementation.
- π§π·Brazil mabho Rio de Janeiro, RJ
I moved my activity into issue thread β¨ Create Javascript library for searching rendered lists on the client. Needs work because it is proposing a single library to be used everywhere a filter is needed. It promotes code reuse and provides a pluggable mechanism that can more easily be reused.
- Status changed to Closed: duplicate
7 months ago 1:48am 16 September 2024