tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.28k stars 1.68k forks source link

Performance bottleneck #245

Open tamtakoe opened 6 years ago

tamtakoe commented 6 years ago

This plugin has two bottlenecks: copyStyle an makeImage functions

Any node of e.g. css Bootstrap project has ~6KB styles (in the cssText). Ordinary project has several thousands of nodes. This leads to copying 10-50MB of styles for every screen.

makeImage is second bottleneck. It eats CPU and memory. Maybe it can be optimized in case if I need small thumbnail instead of full image.

dom-image-perf

Library version

Browsers