Custom functions efficiency

Hi. I have lots of custom php and js functions that need to be ran or not depending on the user role.
Currently I’m loading them all for all users but each function does the role check as the first line and continues if the role matches.

Is there a more efficient way ?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer