Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Reverse loop to Improve read Performance; #4

Closed
tplaindoux opened this issue Jan 26, 2015 · 0 comments
Closed

Use Reverse loop to Improve read Performance; #4

tplaindoux opened this issue Jan 26, 2015 · 0 comments

Comments

@tplaindoux
Copy link

that's just a minor optimization, but Acl will use a lot the indexOfquery to determinate whether an user can or cannot access a page/ do something.

Mind changing the loop to increase a bit the performance ?
http://jsperf.com/fastest-array-loops-in-javascript/295

I'd recommand:

var l = arr.length;
for(;l--;) {
  someFn(arr[l]);
}
postLoop();
@tplaindoux tplaindoux changed the title Use Negative loop to Improve read Performance; Use Reverse loop to Improve read Performance; Jan 26, 2015
mikemclin referenced this issue Jul 22, 2016
You can check if user has a role.
using hasAnyRole method ([ 'admin', 'manager'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant