Skip to content
New issue

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

Convert Canvas to NAPI #76

Closed
aruneshchandra opened this issue Feb 1, 2017 · 8 comments
Closed

Convert Canvas to NAPI #76

aruneshchandra opened this issue Feb 1, 2017 · 8 comments
Assignees
Milestone

Comments

@aruneshchandra
Copy link
Contributor

No description provided.

@aruneshchandra
Copy link
Contributor Author

Depends on #50 Typed Arrays

@jasongin
Copy link
Member

jasongin commented Feb 1, 2017

I've already partially ported the canvas package to NAPI as part of #41; see related information there. The remaining work items are:

  1. Update already-ported canvas code for recent NAPI changes (error-handling)
  2. Add typed-arrays support to NAPI (Typed arrays #50)
  3. Port the small parts of canvas code that use typed-arrays to NAPI.
  4. Validate the port using canvas's tests, and fix any bugs caused by porting.

@jasongin
Copy link
Member

jasongin commented Feb 6, 2017

I updated the Canvas port to use the new NAPI C++ wrapper classes. It still needs typed-array support.

@jasongin
Copy link
Member

jasongin commented Feb 8, 2017

With typed arrays in the NAPI C API (#90) and the wrapper (#88), I was able to complete the canvas port. All the canvas tests are now passing on the NAPI port! I will try benchmarking it next.

@jasongin
Copy link
Member

jasongin commented Feb 8, 2017

Canvas performance testing is tracked as a separate task (#77), so this one can be closed.

The code is at https://github.com/jasongin/node-canvas/tree/napi2

@jasongin jasongin closed this as completed Feb 8, 2017
@jasongin
Copy link
Member

jasongin commented Feb 8, 2017

While trying to benchmark canvas, I found a bug that is related to some Nan::ObjectWrap::Ref() / UnRef() calls that I'd forgotten I had commented out when porting the code. The lack of references led to the object being deleted only when under memory pressure, causing benchmarks to crash.

Unfortunately as I investigated further into this area of persistent references and weak references, I realized that current NAPI APIs related to those concepts are insufficient. I think I've heard others mention that, though I don't see any existing issue tracking it, so I'll open one.

Meanwhile I'm reopening this issue, since a fully-working and benchmarkable canvas port will depend on fixing the NAPI referencing APIs.

@jasongin jasongin reopened this Feb 8, 2017
@jasongin
Copy link
Member

jasongin commented Feb 8, 2017

Created issue: Weak/strong reference improvements

@aruneshchandra
Copy link
Contributor Author

Looks like this is done, we should reopen this is there are still issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants