-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Zero copy writeFile and writeFileSync #838
Conversation
3bb7b17
to
36655c0
Compare
This is a large API refactor of deno.h which replaces deno_send() and deno_set_response() with deno_respond(). It also adds a req_id parameter to the deno_recv_cb. Make writeFile/writeFileSync use it.
36655c0
to
e1bf02d
Compare
1a3783b
to
2506009
Compare
auto async_data_map = d->async_data_map.Get(d->isolate); | ||
auto context = d->context.Get(d->isolate); | ||
auto req_id_v = v8::Integer::New(d->isolate, req_id); | ||
auto r = async_data_map->Set(context, req_id_v, data_v); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super duper slow. But whatever, it works, it's safe. We can always use externalize later 👿
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya.. we're going to have to benchmark and profile it. The other option is using std::map<int32_t, v8::Persistent<v8::ArrayBufferView>>
which may be faster - but who knows without measuring.
- Adds deno.stdin, deno.stdout, deno.stderr, deno.open(), deno.write(), deno.read(), deno.Reader, deno.Writer, deno.copy() denoland#846 - Print 'Compiling' when compiling TS. - Support zero-copy for writeFile() writeFileSync() denoland#838 - Fixes eval error bug denoland#837 - Make Deno multithreaded denoland#782 - console.warn() goes to stderr denoland#810 - Add deno.readlink()/readlinkSync() denoland#797 - Add --recompile flag denoland#801 - Use constructor.name to print out function type denoland#664 - Rename deno.argv to deno.args - Add deno.trace() denoland#795 - Continuous benchmarks https://denoland.github.io/deno/
- Adds deno.stdin, deno.stdout, deno.stderr, deno.open(), deno.write(), deno.read(), deno.Reader, deno.Writer, deno.copy() #846 - Print 'Compiling' when compiling TS. - Support zero-copy for writeFile() writeFileSync() #838 - Fixes eval error bug #837 - Make Deno multithreaded #782 - console.warn() goes to stderr #810 - Add deno.readlink()/readlinkSync() #797 - Add --recompile flag #801 - Use constructor.name to print out function type #664 - Rename deno.argv to deno.args - Add deno.trace() #795 - Continuous benchmarks https://denoland.github.io/deno/
….prepareStackTrace` (denoland#838) Fixes issues with the `bindings` npm package, as well as `callsites`. Moves all error stack trace formatting to rust, allowing us to remove some ops (`op_set_call_site_evals`, `op_apply_source_map`, and some others). This also moves the stack trace formatting from the `deno` crate to `deno_core` (`format_location` and `format_frame`) this allows us to eliminate some duplication. Previously we had multiple places that were doing formatting that we needed to keep in sync.
This is laying the pipe for zero-copy parameter to
libdeno.send
.Depends on #831.