A very exciting new feature from cocos2D 0.8 is the addition of BitmapFontAtlas support. A BitmapFontAtlas is a combination of 2 files: a definition file (.fnt) and a texture file (.png). Contrary to the LabelAtlas, the font is no longer with fixed-width, and it looks much much better. It's also easier to manage and produce using various tools like Hiero Font Tool
So because It looks so good, I went a little crazy and added a lot of them in my game. Unfortunatly, that's how I discovered a nasty performance issue with it, as each new instance would parse the font definition file, taking a few very noticable ms (look like hicups).
The fix is of course caching, but I wasn't sure the singleton "manager" design pattern would be in the spirit of the cocos lib and also, it would be a very small class so I searched for something else.
The final solution is a static NSMutableDictionnary on the BitmapFontAtlas class itself + a little bit of rerouting in the init method.
You can take a look at the issue & my patch here.
I'm interrested in comments on this trick :)