0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

101 commits

Author SHA1 Message Date
Ryan Dahl
7c2e7c6608
Use gotham-like state for ops (#7385)
Provides a concrete state type that can be dynamically added. This is necessary for op crates.
* renames BasicState to OpState
* async ops take `Rc<RefCell<OpState>>`
* sync ops take `&mut OpState`
* removes `OpRegistry`, `OpRouter` traits
* `get_error_class_fn` moved to OpState
* ResourceTable moved to OpState
2020-09-10 09:57:45 -04:00
Bartek Iwańczuk
f57a2c1e85
refactor(core): rename CoreIsolate to JsRuntime (#7373)
deno_core/
- rename core_isolate.rs to runtime.rs
- rename CoreIsolate to JsRuntime
- rename JSError to JsError
- rename JSStackFrame to JsStackFrame

cli/
- update references from deno_core::CoreIsolate to deno_core::JsRuntime
- rename deno_core::JSError to deno_core::JsError
- rename fmt_errors::JSError to fmt_errors::JsError
2020-09-06 21:44:29 +02:00
Bert Belder
c821e8f2f1
Move JSON ops to deno_core (#7336) 2020-09-06 02:34:02 +02:00
Bert Belder
29e3f4cd3a
Split core http benchmark into 'bin_ops' and 'json_ops' variants (#7147) 2020-08-21 20:21:32 +02:00
Bert Belder
fd83df7cdb
Convert the remaining http_bench ops to json ops (#7143) 2020-08-21 13:11:04 +02:00
Ryan Dahl
0095611af9
First pass at json ops in core (#7033)
Adds Deno.core.jsonOpSync and Deno.core.jsonOpAsync
2020-08-20 09:45:59 -04:00
Ryan Dahl
974215afdd
Simplify deno_core_http_bench op state (#7038)
Removes unnecessary wrappers around ResourceTable and CoreIsolate.

Importantly: now uses the resource table inside CoreIsolateState rather than a different one.

Removes derive_deref dependency
2020-08-17 17:29:01 -04:00
David Sherret
cde4dbb351
Use dprint for internal formatting (#6682) 2020-07-14 15:24:17 -04:00
Valentin Anger
be7e0f2d49
BREAKING(core): Remove control slice from ops (#6048) 2020-07-08 11:23:50 -04:00
Valentin Anger
becbb56b19
feat(core): Ops can take several zero copy buffers (#4788) 2020-06-01 14:20:47 -04:00
Ryan Dahl
d4b05dd89e
refactor: Split isolate and state using safe get_slot() (#5929) 2020-05-29 17:41:39 -04:00
Ryan Dahl
d8711155ca
Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
Ryan Dahl
c1ec042a00
Modify op dispatcher to include &mut Isolate argument (#4821)
- Removes unnecessary RwLock and Rc around the op registry table
- Preparation to move resource_table to deno_core::Isolate.
- Towards #3453, #4222
2020-04-19 23:54:46 -04:00
Ryan Dahl
4d2b9cd37a
Fix Op definitions (#4814) 2020-04-18 20:05:13 -04:00
Kitson Kelly
bced52505f
Update to Prettier 2 and use ES Private Fields (#4498) 2020-03-28 13:03:49 -04:00
Ryan Dahl
0adc86f105
Remove DENO_BUILD_MODE and DENO_BUILD_PATH (#4431)
* Remove DENO_BUILD_MODE and DENO_BUILD_PATH

Also remove outdated docs related to ninja/gn.

* fix

* remove parameter to build_mode()

* remove arg parsing from benchmark.py
2020-03-20 21:48:34 -04:00
Samrith Shankar
798904b0f2
Add require-await lint rule (#4401) 2020-03-20 09:38:34 -04:00
Bartek Iwańczuk
1edb20b399
refactor: add no-return-await lint rule (#4384) 2020-03-16 10:22:16 +01:00
Bert Belder
f650c3edb3
Refactor deno_core_http_bench and make it single-threaded (#3903) 2020-02-07 18:17:03 -08:00
Ryan Dahl
161cf7cdfd
refactor: Use Tokio's single-threaded runtime (#3844)
This change simplifies how we execute V8. Previously V8 Isolates jumped
around threads every time they were woken up. This was overly complex and
potentially hurting performance in a myriad ways. Now isolates run on
their own dedicated thread and never move.

- blocking_json spawns a thread and does not use a thread pool
- op_host_poll_worker and op_host_resume_worker are non-operational
- removes Worker::get_message and Worker::post_message
- ThreadSafeState::workers table contains WorkerChannel entries instead
  of actual Worker instances.
- MainWorker and CompilerWorker are no longer Futures.
- The multi-threaded version of deno_core_http_bench was removed.
- AyncOps no longer need to be Send + Sync

This PR is very large and several tests were disabled to speed
integration:
- installer_test_local_module_run
- installer_test_remote_module_run
- _015_duplicate_parallel_import
- _026_workers
2020-02-03 18:08:44 -05:00
Ryan Dahl
5e32c5ea44
s/PinnedBuf/ZeroCopyBuf (#3782) 2020-01-24 15:10:49 -05:00
Bartek Iwańczuk
d776ca8f2e
fix deno_core_http_bench (#3698) 2020-01-17 15:26:51 +01:00
Andy Finch
fe5662058e feat: support individual async handler for each op (#3690) 2020-01-17 08:26:11 -05:00
Bartek Iwańczuk
0d0ad360d3
refactor: remove Isolate.current_send_cb_info and DenoBuf, port Isolate.shared_response_buf (#3643)
* remove Isolate.current_send_cb_info
* remove DenoBuf
* remove Isolate.shared_ab
* port Isolate.shared_response_buf (last bit not ported from libdeno)
* add some docs for Isolate and EsIsolate
2020-01-11 10:49:16 +01:00
Ry Dahl
76e44ddfd0
Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600) 2020-01-05 11:56:18 -05:00
Axetroy
3bb15ceaea Upgrades rust to 1.40.0 (#3542) 2019-12-23 09:59:44 -05:00
Bartek Iwańczuk
e1eb458cad upgrade: tokio 0.2 in deno_core_http_bench, take2 (#3435) 2019-12-15 18:47:26 +08:00
Ry Dahl
a537c03df7
Revert "update deno_core_http_bench to Tokio 0.2 (#3408)"
It seems this has caused CI to go red for an unknown reason.

This reverts commit 866dba8aa1.
2019-11-27 08:03:58 -08:00
Bartek Iwańczuk
866dba8aa1 update deno_core_http_bench to Tokio 0.2 (#3408) 2019-11-26 18:07:40 -08:00
Andy Finch
b6b813cbfc feat: op registration during calls (#3375) 2019-11-18 21:13:04 -05:00
Bartek Iwańczuk
a2f5bccad7 fix deno_core_http_bench (#3364) 2019-11-17 09:44:22 -05:00
Bartek Iwańczuk
f356b2bd5e refactor: fixes for futures (#3363)
After landing #3358 the benchmarks exploded indicating problems with workers and deno_core_http_bench.

This PR dramatically fixes thread/syscall count that showed up on benchmarks. Thread count is not back to previous levels but difference went from hundreds/thousands to about ~50.
2019-11-17 08:14:50 -05:00
Bartek Iwańczuk
8f9a942cb9 Use futures 0.3 API (#3358) 2019-11-16 19:17:47 -05:00
Ry Dahl
5c1deac0cf
Remove CoreResource::inspect_repr method (#3274)
Towards simplifying (or better removing entirely) the CoreResource
trait. Resources should be any bit of privileged heap allocated memory
that needs to be referenced from JS, not very specific trait
implementations. Therefore CoreResource should be pushed towards being
as general as possible.
2019-11-06 12:17:28 -05:00
Bartek Iwańczuk
a7992e7703 refactor: use core ResourceTable in cli (#3206) 2019-10-28 20:42:44 -04:00
Bartek Iwańczuk
029e833075 core: Add ResourceTable (#3150) 2019-10-23 12:32:28 -04:00
Bartek Iwańczuk
4221b90c3f perf: eager poll async ops in Isolate (#3046) 2019-10-14 17:46:27 -04:00
Bartek Iwańczuk
ffbf0c20cc feat: op registration in core (#3002) 2019-09-30 14:59:44 -04:00
Ryan Dahl
e438ac2c74
Add op_id throughout op API (#2734)
Removes the magic number hack to switch between flatbuffers and the
minimal dispatcher.

Adds machinery to pass the op_id through the shared_queue.
2019-08-07 14:02:29 -04:00
Ryan Dahl
3971dcfe10
Use system rustfmt instead of fixed binary (#2701) 2019-07-31 17:11:37 -04:00
Bert Belder
abe8a113ad Refactor error to use dynamic dispatch and traits
This is in preperation for dynamic import (#1789), which is more easily
implemented when errors are dynamic.
2019-07-11 14:37:00 -04:00
andy finch
76d51b0f9a refactor dispatch take 2 (#2533) 2019-06-17 18:02:08 -07:00
Ryan Dahl
1361e30223 Revert "Refactor dispatch handling (#2452)"
Due to performance regression:
dc60fe9f30 (commitcomment-33943711)

This reverts commit dc60fe9f30.
2019-06-14 13:56:36 -07:00
andy finch
dc60fe9f30 Refactor dispatch handling (#2452)
Promise id is now created in core and passed back to JS.
2019-06-13 20:43:54 -07:00
Ryan Dahl
2a5138a516
Remove Config struct from core (#2502)
It's unnecessary indirection and is preventing the ability to easily
pass isolate references into the dispatch and dyn_import closures.

Note: this changes how StartupData::Script is executed. It's no longer done
during Isolate::new() but rather lazily on first poll or execution.
2019-06-12 10:53:24 -07:00
Ryan Dahl
c171813e89
core: express op as enum (#2255) 2019-05-01 18:22:32 -04:00
Bert Belder
41c7e96f1a
Refactor zero-copy buffers for performance and to prevent memory leaks
* In order to prevent ArrayBuffers from getting garbage collected by V8,
  we used to store a v8::Persistent<ArrayBuffer> in a map. This patch
  introduces a custom ArrayBuffer allocator which doesn't use Persistent
  handles, but instead stores a pointer to the actual ArrayBuffer data
  alongside with a reference count. Since creating Persistent handles
  has quite a bit of overhead, this change significantly increases
  performance. Various HTTP server benchmarks report about 5-10% more
  requests per second than before.

* Previously the Persistent handle that prevented garbage collection had
  to be released manually, and this wasn't always done, which was
  causing memory leaks. This has been resolved by introducing a new
  `PinnedBuf` type in both Rust and C++ that automatically re-enables
  garbage collection when it goes out of scope.

* Zero-copy buffers are now correctly wrapped in an Option if there is a
  possibility that they're not present. This clears up a correctness
  issue where we were creating zero-length slices from a null pointer,
  which is against the rules.
2019-05-01 21:11:09 +02:00
Ryan Dahl
d68b44b6b2
core: make Isolate concrete, remove Dispatch trait (#2183)
Op dispatch is now dynamically dispatched, so slightly less efficient.
The immeasurable perf hit is a reasonable trade for the API simplicity
that is gained here.
2019-04-23 18:58:00 -04:00
Bartek Iwańczuk
cd19da62d9 Refactor CLI entry point (#2157)
Changes "deno --types" to "deno types"
and "deno --prefetch" to "deno prefetch"
2019-04-21 11:34:18 -04:00
Bert Belder
8477daa8b9
Fix clippy warnings 2019-04-17 15:35:46 +02:00
Ryan Dahl
79a974229a
Move deno_core_http_bench into examples dir (#2127) 2019-04-16 17:53:43 -04:00