Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm curious about the speed hit of these parsed expressions. Do you know if they are pre-compiled into anonymous functions, or if they are parsed on the fly?


See: https://github.com/angular/angular.js/blob/9480136d9f062ec4b...

Looks like they are never interpreted, but there are (at least) two different compilation strategies: 1) Anonymous function with a loop 2) Fully compiled Function constructed via JavaScript source with the loop unrolled In general, this bit of code seems to be optimized to a crazy degree.

It's also worth noting that the "filters" part of the expression is maintained as a pipeline in an array, since filters may inform bidiectional binding behavior.


Was thinking the same thing. My guess is on-the-fly parsing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: