saliences.com : Webln

updated: mustache.js improved
October 10, 2011 @ 9:33 PM
Music: Alfh Lyra - Theme of World Champions

A new version of my implementation of Mustache.js which implements Dot Notation support from the mustache specification is now available.

Try it out.

updated: mustache.js improved
April 28, 2011 @ 11:01 PM
Music: Chiddy Bang - Opposite of Adults

Over the last two days, I have been improving my implementation of Mustache.js using something that I have been calling fat-strides. The basic premise is that the existing tokenizer in the parser is not very smart in that it creates tokens that are too small, which results in a more complicated finite state machine than is strictly necessary. With fat-strides, I increased the size of the tokens by making the lexer much more intelligent. As a result, the parser is now smaller (17 kb versus 23 kb uncompressed), produces smaller code (the compiled mustache programs have far fewer function blocks in them), and is generally 10% faster then the predecessor which was already hella fast. In addition to all of those goodies, the parser will now give you detailed error information about the templates (partial names, line, and character numbers).

All of this is great, but the end goal of all this is to make this implementation of the Mustache syntax be complaint with the Mustache specification, which is the next step and work is already well underway.

Try it out, you will not be disappointed.

string-measurement.js
March 12, 2011 @ 2:22 PM
Music: The Cardigans - If There is a Chance
Rocks: TortoiseHg

Measuring the dimensions of a string is a problem that I have run into quite frequently whilst doing web development. The problem mainly arises when having to see if a string will fit into a particular container and if not, cropping the string and adding ellipsis to give a more visually pleasing representation of the string.

I have created a tiny little JavaScript library that will do these exact set of operations as quickly as possible: string-measurement.

Released under the MIT License. Enjoy!

mustache.js improved
November 28, 2010 @ 11:05 PM
Music: Bright Eyes - If the Brakeman Turns My Way

mustache.js improved is an implementation of the Mustache templating syntax written in JavaScript that adds Compiled Templates support for speedy execution times in situations where templates are either complex or a high number of repetitions are required.

FIrefox UI Stall bug
November 3, 2010 @ 11:13 PM
Music: E.S. Posthumus - Tikal

If you have ever used Firefox for extended periods of time, you know that it is prone to periodic UI thread stalls once the session becomes sufficiently long lived. Worse still, it seems as if extensions such as Firebug make matters even worse.

I have created a test case that demonstrates this bug.

It is interesting because it seems like a fairly big hole in Firefox’s garbage collector since the memory wasted by all the DOM object allocations is never reclaimed. The allocations are not particularly complex from a GC perspective either since they are non-cyclical (I think!) and low reference count.

This particular bug is probably my biggest grievance with Firefox at this particular moment.

Show 3 earliest entries.
Show 5, 10, or 20 entries at a time.