Skip to content
Discussion options

You must be logged in to vote

It depends what are you doing.
If you just want to copy the current canvas in a blob, you can try to avoid the fabricJS render cycle and just copy it.
toBlob will take a fabricJS canvas data and produce a new image, going through the rendering.
If you already have that data displayed in a canvas on the screen at the right resolution you can grab the canvas element and run toBlob from there.

like:

fabricCanvas.lowerCanvasEl.toBlob()

That will take only the raw performance of toBlob with no fabricjs code involved.

I see from your flamegraph you were also using cache there and that is fine, but we know for things like toBlob we have like do cache optimizations yet because the cache is lost …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@She-yh
Comment options

@She-yh
Comment options

@asturur
Comment options

Answer selected by She-yh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants