It turns out that that laggy frame-dropping business is a problem on my end and not with the code. How horrifying.