-
Simple Get
My main project at work uses large JavaScript objects for a data store. Our team used a very cool method to dynamically create null-safe getter functions and cache them for reuse. Oh, and did I mention it was fast?
Read more... -
Variadic Composition Without Recursion
I recently caught up on some technical reading. I’m particularly enjoying posts related to functional programming. One downside to functional programming is the performance hit we take jumping scope and making extra function calls for things we could just do in a single block.
Read more... -
Sparse Arrays For String Building
A sparse array is an instance of
Read more...Array
that hasundefined
as one or more members. I’ve seen them used, for performance reasons, in game engines to pre-allocate a buffer. I believe it has something to do with one versus two operations–altering a member versus adding a member and increasing length. But there are other uses for them if you know what you can and can’t do with them. -
Indexof Vs Regexp
While writing a handler for key events, I realized I was having to convert the event’s key data to test for valid inputs every time. I wondered if using a list of valid inputs would be faster than checking a regular expression.
Read more... -
Decimal Precision
While reading the answers to Nathan Smith’s JavaScript Quiz, I was struck by the number of assumptions made around decimal precision. In two places, the author states “you need to multiply values by
Read more...10
” when in actuality, you need to multiply values by the precision’s power of ten.