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

Optimized representations #15714

Closed
larsbergstrom opened this issue Jul 16, 2014 · 6 comments
Closed

Optimized representations #15714

larsbergstrom opened this issue Jul 16, 2014 · 6 comments

Comments

@larsbergstrom
Copy link
Contributor

A key worry in a web browser is the size of data. We'd like to know that e.g. an enum with a single pointer constructor and 5 nullary constructors can still fit into a single machine word on 64-bit architectures. All of these optimizations need to work with custom smart pointer types, but we also need to be able to disable them for some smart pointers, e.g. pointers that are tracked by an external GC.

CC: @zwarich @pcwalton

@thestinger
Copy link
Contributor

A key worry in a web browser is the size of data. We'd like to know that e.g. an enum with a single pointer constructor and 5 nullary constructors can still fit into a single machine word on 64-bit architectures.

It's not possible to do this because Rust allows taking references to the values inside an enum. It can't use tagged pointers without breaking the language semantics.

@thestinger
Copy link
Contributor

Since this would be a language change rather than an optimization in the compiler, it needs to go through the RFC process. I really don't know how it would fit into the enum system though. It would need to forbid using ref / ref mut for a variant.

@pnkfelix
Copy link
Member

Made a fork off in discuss.rust-lang.org: http://discuss.rust-lang.org/t/optimized-representations/511 to allow continued discussion that could perhaps lead to an RFC in the future.

@brson
Copy link
Contributor

brson commented Sep 16, 2014

Since this is an issue that impacts servo I want to continue to track it.

@brson brson reopened this Sep 16, 2014
@brson brson added the A-servo label Sep 16, 2014
@thestinger
Copy link
Contributor

It would be backwards compatible and would need to go through an RFC so I don't really think it belongs on the issue tracker. The bug tracker is filled with non-actionable issues and that means it's a much less useful for tracking bugs and actionable feature requests. This isn't a good place to hold open discussions about stuff.

@rust-highfive
Copy link
Contributor

This issue has been moved to the RFCs repo: rust-lang/rfcs#317

bors added a commit to rust-lang-ci/rust that referenced this issue Nov 13, 2023
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

No branches or pull requests

5 participants