Profiling Bangle apps (sort of)

Posted on
  • While trying to find methods using a lot of time I thought of automatically wrapping all functions in an object to get some statistics. I came up with this: https://gist.github.com/halemmerich/a2e9­0fc2ea1aefd2bed8a20d3fb3bdf0

    This does not seem to work for things like Bangle.#ontouch. While I can do Object.keys(Bangle.["#ontouch"]).length from the IDE terminal to detect if there is an array of functions in there, the code in the gist line 9 does not seem get the array. Generally the recursion path is not taken, as if everything is type function.

    Ideas anyone?

  • That sounds like a neat idea... You might be hitting the issue that if Bangle.#ontouch has one event handler it's stored just as the handler to save space, but if you have more than one it's an array - so you could instead check if it's an array first?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Profiling Bangle apps (sort of)

Posted by Avatar for halemmerich @halemmerich

Actions