I was hoping it was the rendering code that was the problem but I'm almost 100% certain that it isn't. If I just allow the emulation to run without drawing anything to the HTML canvas (and just writing a frame count to the console) the performance is still the same.
Good tip about Ebiten though. I don't think it'll help with my immediate problem but it shouldn't be too difficult to add it as an alternative presentation method. The main reason I opted for SDL was because I was familiar with it. Ebiten might be a good alternative. On Sat, Sep 4, 2021 at 11:34 AM Arnaud Delobelle <arno...@gmail.com> wrote: > Hi Stephen, > > I haven't really looked at your code in detail but one obvious > difference between your version and the original is the rendering > code. Are you certain that the slowness is not confined to your > rendering code (I have no reason to believe it is btw)? > > Here is a suggestion. I have had a good experience using a 2d library > called ebiten (https://github.com/hajimehoshi/ebiten). It abstracts > the rendering and can target native or browsers via wasm. In my > experience performance when targeting the browser has been acceptable, > so you could write an implementation of television.PixelRenderer > backed by ebiten. You could then compile both to native and wasm and > see if there is still a big performance difference? > > HTH > > Arnaud > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAPmHGLNpp_g8L0BbpniA1Lghxv1N6F5d5MXtW9sKrm8Q4MQ6sw%40mail.gmail.com.