Hi Sander, I agree. Not trying to optimize prematurely. But - this is a good thing to know. I work on an app that is massive ( > 100k LOC - maybe closer to 200k) , so these kinds of things are important in the long run to know I guess ?
Between the expression and the function - my question was basically what if you wrapped the expression in a function and exposed the function - as opposed to directly binding to the expression itself. My Understanding is that if angular finds expressions in the template it evals the expression and sets up watchers to all the objects found within the eval ? While in case of a function it continuously calls the function on every digest cycle ? I am not sure about this. I guess will have to setup a plunker to test. But I believe the general wisdom is that functions in templates are costlier and wanted to validate it! On Wed, Sep 17, 2014 at 1:13 PM, Sander Elias <[email protected]> wrote: > Hi Ganaraj > > Unless your expression/function is executed 10.000 or more times, the > difference is of no importance. > You can do some micro bench-marking, to find out what is faster. If you do > this, you will > find out that it is highly dependable on the expression / function you are > executing. Depending on that, > sometimes a expression is faster, while at other times, a function is > faster. > > To be short, don't optimize premature! > > Regards > Sander > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- Regards, Ganaraj P R -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
