-
Notifications
You must be signed in to change notification settings - Fork 0
Home
BEM template function should be implemented in native code.
To be ready for production use, I'd probably implement fallback to V8, if it's not very hard.
Before applying template function, convert Python bemjson tree into C struct tree. Required fields are inferred from template. Really dynamical field assignment and retrieval could be supported by storing pointer to original tree node. This should improve performance by much, because property access is expensive and done often, while creating C structures is almost free.
Interning of tree and template strings could possible speedup template processing, because there are many comparisons, and cost of interning should be not very high.
Probably there should be two implementations of switch statement: if else if sequence and Python hash. Second should be more efficient when there are many choices.
Operators should be implemented as inline functions.