mulesoft/api-designer — pull request #166 by xaka (2014-01-13 22:35:16+00:00)
Title: Optimize functions and apply formatting to code

all:
- code formatting
- add new lines between blocks of code for readability and overall code consistency
- add spaces between // and actual comment for readability and overall code consistency
- remove unused dependency injections
- extract getSpaceCount into lightweightParse and use it as much as possible

codeFolding:
- remove obsolete functions

lightweightDOM:
- comibe createNode and getNode together as those were just delegating the work to each other
- move cutting current line up to cursor's position from LazyNode constructor to getNode
- add caching optimization by storing nodes per lines; cache is invalidated every time
line has been changed; we have to do so to stop GC from bothering us because we create and destroy
hundred of thousands LazyNode objects that stay unchanged during computations
- convert node's key and value properties to getKey and getValue getters to become 100% lazy :)
and improve performance as not every line of code is using those

lightweightParse:
- improve and optimize almost every single function to gain ~5-10x performance increase

TODO:
- keep using RAML DOM more and more as it leads to smaller and less repeatable code