Hello, I’m working with websockets in Ember and trying to devise a best-practice approach for live updates to the UI.
Initially I had created an Ember service which utilized the ember-websockets
addon and received formatted websocket data and simply called JSON.parse
followed by store.pushPayload(parsedData)
. This approach did what I wanted it to do in that it properly updated the Ember store with new records from websocket updates.
The problem arose when I started doing some stress testing and immediately noticed that my websocket receiver was being heavily slowed down by the above process. I got some initial improvements by swapping out the ember-websockets
for plain JS websocket usage but the main bottleneck is still with the store.pushPayload
.
My use case is I basically have a table of read-only data (basically a logviewer) which I want to update in realtime with incoming websocket messages. From my testing, it seems that leveraging Ember data to provide the live updates to the views is creating a performance bottleneck. I was curious if there was any best practices or alternative approaches that anyone is following.
My thoughts are Ember data might be too much overhead since we are just dealing with an array of read-only data; the store really shines when you have models that require the full spectrum of CRUD operations.
1 post - 1 participant