I've found some tips about making things run faster in RF and I want to share them here. I hope they're useful for others too:
1. Python objects are faster than RF font objects
I realized if my script is run once, it's better if I convert RF objects to python objects. This way in many cases there is a huge performance boost. This could also be dangerous if you keep the data after user made changes to the font. So if you want to do something once and you're done after, this might help. Here is a very small public gist, but it's a start:
https://gist.github.com/typoman/38a41811ad5dd8eb16a9d8acb6519a7f
2. Representation factories
If you're making a user interface and are calculating something every time user makes a change, the representation factory is the way to cut some time. This is how you can cache data in font. Representaions can be anything, it doesn't have to be a visual data. RoboFont already has many. Like Glyph.area which gives you the surface area of the glyph. You can find how to make representation factories here:
https://github.com/robotools/defcon/blob/master/documentation/source/concepts/representations.rst
An example:
https://github.com/typesupply/glyph-nanny/blob/2d41cc0e200726b2ddc5ffda3f85caeee7a7235b/Glyph Nanny.roboFontExt/lib/glyphNanny.py#L627