Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Ask Reuben 43 - Options Short Circuit  (Read 3989 times)
Reuben B.
Four Js
Posts: 1049


« on: August 20, 2020, 05:56:58 am »

If you are trying to improve the performance of a program you can use the profiler to measure what percentage of time the program spends in a function and code coverage to measure how many times a line is executed.  (I should do an ask-reuben on these tools one day).

What this output might show you is functions being evaluated more often than you expect.  For example with ...

IF a() AND b() THEN

... is it necessary to evaluate b() if a() is FALSE, it won’t change the result of the IF.  OPTIONS SHORT CIRCUIT gives you some control over wether the code should compile to evaluate the second expression or not.

Read more at https://4js.com/ask-reuben/ig-43/

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines