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

Zero copy writeFile and writeFileSync #838

Merged
merged 2 commits into from
Sep 27, 2018
Merged

Conversation

ry
Copy link
Member

@ry ry commented Sep 26, 2018

This is laying the pipe for zero-copy parameter to libdeno.send.

Depends on #831.

@ry ry force-pushed the zero_copy_write_file branch 3 times, most recently from 3bb7b17 to 36655c0 Compare September 27, 2018 02:19
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.
@ry ry mentioned this pull request Sep 27, 2018
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);
Copy link
Member

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 👿

Copy link
Member Author

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.

@ry ry merged commit d38ccfc into denoland:master Sep 27, 2018
@ry ry deleted the zero_copy_write_file branch September 27, 2018 21:33
ry added a commit to ry/deno that referenced this pull request Sep 29, 2018
- 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/
@ry ry mentioned this pull request Sep 29, 2018
ry added a commit that referenced this pull request Sep 29, 2018
- 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/
hardfist pushed a commit to hardfist/deno that referenced this pull request Aug 7, 2024
….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.
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

Successfully merging this pull request may close these issues.

2 participants