YashasSamaga

Untitled

Feb 6th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. one_of_my_functions()
  2. {
  3. while(some cond)
  4. {
  5. myfunc.execute(params_array);
  6. //myfunc is already initialized and has a member variable which stores information about the function which has to be executed
  7. //myfunc has code which does a check to first find what type of func (plugin_func, external_func, etc.) it is after which it does a few more checks to see how many arguments it accepts
  8. //then it checks if any parameters are bind-ed
  9. //after all that the function is called
  10. }
  11. }
  12. //the issue is
  13. //the same checks are going to be repeated for over 10000 iterations which is a waste of CPU
  14. //I can get rid of repeating checks by moving them outside the loop
  15. //but that would be a bad idea because
  16. //1. myfunc.execute code is used in over 100 functions
  17. //2. it would bloat the one_of_my_functions code
Add Comment
Please, Sign In to add comment