Skip to content

Allow for isolates to share memory of immutable objects #49876

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

Closed
feinstein opened this issue Aug 31, 2022 · 2 comments
Closed

Allow for isolates to share memory of immutable objects #49876

feinstein opened this issue Aug 31, 2022 · 2 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug

Comments

@feinstein
Copy link

As far as I understand from the docs, a SendPort will copy the data being transmitted to the ReceivePort, while Isolate.exit() won't copy the data, just pass the object reference to the original Isolate, if both are on the same Isolate Group.

I believe there might be a chance to improve the performance further. If we annotate a class with @immutable, in theory that object could be shared with multiple threads, so we could send it to another Isolate without copying it.

I imagine there might be other complications behind the scenes, but I wanted to suggest if there's a way for us to improve the performance for Isolates.

I thinking about a use case for my trading app, where I need a separate Isolate to receive low latency, real time stock data, parse it into immutable objects, and send them to the main Isolate.

@devoncarew devoncarew added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Aug 31, 2022
@a-siva
Copy link
Contributor

a-siva commented Aug 31, 2022

Please refer to dart-lang/language#125 for a discussion on this feature.

@a-siva a-siva added the type-enhancement A request for a change that isn't a bug label Aug 31, 2022
@feinstein
Copy link
Author

Thanks @a-siva, I will close this one then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants