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

Comments

Projects
None yet
5 participants
@larsbergstrom
Copy link
Contributor

larsbergstrom commented Jul 16, 2014

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

This comment has been minimized.

Copy link
Contributor

thestinger commented Sep 16, 2014

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 thestinger closed this Sep 16, 2014

@thestinger

This comment has been minimized.

Copy link
Contributor

thestinger commented Sep 16, 2014

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

This comment has been minimized.

Copy link
Member

pnkfelix commented Sep 16, 2014

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

This comment has been minimized.

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

@pnkfelix pnkfelix added the I-wishlist label Sep 17, 2014

@thestinger

This comment has been minimized.

Copy link
Contributor

thestinger commented Sep 19, 2014

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

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Sep 24, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.