The profile actually shows the freeze is not caused by normal JS garbage collection, but by cycle collection. So probably something related to DOM nodes.
Looks like the lag can be fixed by only updating b.innerText once per frame. This seems like a ff bug to be honest, but it appears that rapidly updating the size of innerText is the culprit.
But even then it's just one giant text node, not html elements so it's surprising this is causing so much GC in Firefox.