tileserver-gl icon indicating copy to clipboard operation
tileserver-gl copied to clipboard

Replace canvas with @napi-rs/canvas

Open beeing opened this issue 1 year ago • 4 comments

A suggestion for performance improvements.

Reviewing at the benchmark in https://www.npmjs.com/package/@napi-rs/canvas, this will be quick win for faster canvas replacement.

Thanks for your consideration.

beeing avatar Jul 01 '24 02:07 beeing

If someone wanted to make a PR it would be great to test the difference. Is the platform support the same (macos/linux/windows)?

acalcutt avatar Jul 04 '24 16:07 acalcutt

Due to https://github.com/Automattic/node-canvas/issues/2448 this might also be required to avoid problems with recent node versions

cmahnke avatar Dec 23 '24 09:12 cmahnke

As per the library intro, it is zero dependencies.

Also its still in pre-release and not fully supporting all functions yet as per https://github.com/Brooooooklyn/canvas/issues/113

However, we can test it out first since the performance is much desirable.

beeing avatar Apr 17 '25 15:04 beeing

I made the switch for a very small project. It was very seamless and immediately fixed a bunch of issues caused by node-canvas memory management bugs. YMMV but my experience with @napi-rs/canvas was fantastic.

rgigger avatar May 07 '25 16:05 rgigger