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

Don't switch to the C stack when there is room on the Rust stack #4480

Closed
brson opened this issue Jan 14, 2013 · 6 comments
Closed

Don't switch to the C stack when there is room on the Rust stack #4480

brson opened this issue Jan 14, 2013 · 6 comments
Assignees
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@brson
Copy link
Contributor

brson commented Jan 14, 2013

If there is sufficient room on the Rust stack to run a particular foreign function then we don't need to switch stacks. Each scheduler has a native stack size so we just need the Rust segment to be larger than that (and they can be much larger).

At that point we can annotate specific functions in core with their required stack size. It could significantly reduce the number of stack switches we do.

@brson
Copy link
Contributor Author

brson commented Jan 14, 2013

Related to #4479

@graydon
Copy link
Contributor

graydon commented Apr 30, 2013

@pcwalton is this in-scope or related to what you're doing in 0.7?

@graydon
Copy link
Contributor

graydon commented Apr 30, 2013

assigning bug; change assignment if you disagree

@ghost ghost assigned pcwalton Apr 30, 2013
@brson
Copy link
Contributor Author

brson commented Jun 29, 2013

Not going to make 0.7

@bblum
Copy link
Contributor

bblum commented Jul 3, 2013

I remember thinking about this case a bit during my starter project last summer. This is definitely a feasible optimization, but you have to be careful(?) in the case where C calls back to Rust (what was once charmingly called "crust" functions).

nominating production-ready

@graydon
Copy link
Contributor

graydon commented Aug 1, 2013

subsumed in #3678

@graydon graydon closed this as completed Aug 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

4 participants