samdenty / console-feed

Captures console.log's into a React Component 🔥
https://stackblitz.com/~/github.com/samdenty/console-feed
MIT License
688 stars 109 forks source link

Big performance improvement #56

Closed RealPeha closed 4 years ago

RealPeha commented 4 years ago

The ConsoleMessage component should never be updated unless the amount changes. PureComponent didn't solve the problem, so I added shouldComponentUpdate

Before (with PureComponent): image

Now (with shouldComponentUpdate): image

This gave an incredibly large performance gain, at the native console level

sbellone commented 4 years ago

Hello! Nice perf improvements :) One thing, this has changed the behaviour when you want to update a log displayed in your component, as shown in this sandbox: https://codesandbox.io/s/console-feed-forked-3ev3o?file=/src/demo/index.js The first log stays displayed. Is it possible to force a refresh of the display? Thanks!