We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const { createCanvas } = require('@napi-rs/canvas') async function main() { const canvas = createCanvas(300, 320) const ctx = canvas.getContext('2d') ctx.lineWidth = 10 ctx.strokeStyle = '#03a9f4' ctx.fillStyle = '#03a9f4' ctx.strokeRect(75, 140, 150, 110) ctx.fillRect(130, 190, 40, 60) ctx.beginPath() ctx.moveTo(50, 140) ctx.lineTo(150, 60) ctx.lineTo(250, 140) ctx.closePath() ctx.stroke() await canvas.encode('png') } async function bench() { console.log('before', process.memoryUsage()) for (let i = 0; i < 1000; i++) { await main() } console.log('after', process.memoryUsage()) } bench()
when using @napi-rs/[email protected]
@napi-rs/[email protected]
before { rss: 41500672, heapTotal: 5509120, heapUsed: 5015784, external: 372846, arrayBuffers: 37937 } after { rss: 116674560, heapTotal: 6041600, heapUsed: 4042200, external: 2749665, arrayBuffers: 10458 }
before { rss: 40894464, heapTotal: 5509120, heapUsed: 5015976, external: 372846, arrayBuffers: 37937 } after { rss: 358780928, heapTotal: 6041600, heapUsed: 4042216, external: 2749665, arrayBuffers: 10458 }
0.1.41 -> 0.1.42 the rss usage 200% increasement in this case
0.1.41
0.1.42
my device: Node.js v16.20.2 | Linux x86_64 GNU/Linux | AMD EPYC 7Y83 64-Core Processor | MemTotal 25339608 kB
in this case 0.1.40 ~ 0.1.41 is ok, 0.1.42 ~ 0.1.44 will see the increasement
0.1.40
0.1.44
The text was updated successfully, but these errors were encountered:
Duplicate #716
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Use this case
when using
@napi-rs/[email protected]
when using
@napi-rs/[email protected]
0.1.41
->0.1.42
the rss usage 200% increasement in this casemy device: Node.js v16.20.2 | Linux x86_64 GNU/Linux | AMD EPYC 7Y83 64-Core Processor | MemTotal 25339608 kB
in this case
0.1.40
~0.1.41
is ok,0.1.42
~0.1.44
will see the increasementThe text was updated successfully, but these errors were encountered: