Crawford: Why mobile web apps are slow
Posted Jul 22, 2013 10:10 UTC (Mon) by man_ls
Parent article: Crawford: Why mobile web apps are slow
For me, the most interesting point in the article is RubyMotion: from what I understand, some Ruby hackers tried to use scoping rules to have fast, automatic GC.
var a in a function; it is created automatically with refcount 1, and it would be destroyed when the function returns (by default at the end of the code). But if this variable is passed to another function, then its refcount would increase to 2, so both the original and the called functions have to return for the variable to be deallocated. And so on.
There are many refinements: allocating attributes inside objects, deleting array elements and so on. But the basic idea is sound IMHO. Perhaps the Ruby hackers could not make it work for some reason, but as a new idea I would expect it to take a few iterations to get right.
It remains to see if this approach would consume too much memory just to keep track of all allocations at runtime. But I suspect that the overhead would be about twice the memory, instead of 5~6 as the article says for traditional GC. I would gladly give it a shot if it was available.
to post comments)