Components with large datasets runs slow on IE11/Edge only

前提是你 提交于 2019-12-03 13:34:07

Things to try improve IE performance:

  • check you are running in production mode (which removes things like prop validation) and make Webpack / Babel optimisations where applicable

  • Render the page server side so IE has no issues (if you can support SS rendering in your setup)

  • Make sure render isnt called alot of times, tools like this are helpful: https://github.com/garbles/why-did-you-update

  • Any reason why you are using dangerouslySetInnerHTML? If you take out the dangerouslySetInnerHTML does it speed things up dramatically? Why not just automatically generate the rows and cols based on a array of objects (or multidimensional array passed), im pretty sure then React will make less DOM interaction this way (makes use of the VDOM). The <tr> and <td>'s will be virtual dom nodes.

  • Use something like https://github.com/bvaughn/react-virtualized to efficiently render large lists

Shot in the dark: try not rendering, or not displaying, until everything is completely done.

  • make the table element display:none until it's done
  • render it offscreen
  • in a tiny DIV with hidden overflow
  • or even output to a giant HTML string and then insert that into the DOM upon completion.

In addition to @Marty's excellent points, run a dynaTrace session to pinpoint the problematic code. It should give you a better insight into where the bottleneck is. It's results are often more useful than the IE developer tools.

Disclaimer - I am not linked with the dynaTrace team in any way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!