Archive for the ‘performance’ Category

One aspect of lazy computation

Thursday, April 23rd, 2009

I've often needed to do a combination of filtering and mapping on arrays. E.g. in a Ruby on Rails app, I might have a list of "RecurringActivation" model objects which have a product_id and an integer period. Now I would like a list of product_ids where the current time "matches" ...

Manual code specialization:a poor-mans partial evaluation in JavaScript

Friday, July 4th, 2008

Recall the object function that Douglas Crockford is promoting in his work on prototypal inheritance in JavaScript: function object(p) { function F(){} F.prototype = p; return new F(); } The object function creates a new object which has the input object (p) as it's prototype. On the comp.lang.javascript ...