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

feat: op registration during calls #3375

Merged
merged 3 commits into from
Nov 19, 2019
Merged

Conversation

afinch7
Copy link
Contributor

@afinch7 afinch7 commented Nov 18, 2019

prerequisite for #3372

core/isolate.rs Outdated Show resolved Hide resolved
core/Cargo.toml Outdated Show resolved Hide resolved
dispatchers: Vec<Box<OpDispatcher>>,
name_to_id: HashMap<String, OpId>,
dispatchers: RwLock<Vec<Arc<Box<OpDispatcher>>>>,
name_to_id: RwLock<HashMap<String, OpId>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭 this might impact performance, hot path will require to acquire a read lock everytime

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like it did in benchmarks.

Copy link
Member

@bartlomieju bartlomieju Nov 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but they're flaky... Anyway why do you need to put dispatchers behind the lock? In native plugin PR you already have Arc<Mutex<Isolate>> available so you should be able to register new ops quite easily

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases during dispatch we already have a lock on isolate somewhere else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see... I'm curious to see it combined with native plugins PR

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I'm worried about the locks too, but I think we need this functionality. Let's keep an eye on the benchmarks after this and see if there are any noticeable regressions.

( and this nice work @afinch7 )

@ry ry merged commit b6b813c into denoland:master Nov 19, 2019
@afinch7
Copy link
Contributor Author

afinch7 commented Nov 19, 2019

It doesn't look like it messed with the benchmarks much at all. I think it would take something pretty drastic on the rust side to really be noticeable beyond max latency.

bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Dec 28, 2019
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.

3 participants