-
Notifications
You must be signed in to change notification settings - Fork 363
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
KEEP for multi-field value classes #339
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Jake Wharton <github@jakewharton.com>
Co-authored-by: Andrew Mikhaylov <mail@r4zzz4k.me>
|
||
### Further development: `VArray`s and reification | ||
|
||
One of other important steps of Value classes feature are Value arrays (`VArray`s) and reified classes and reified not-inline functions. They significantly extend applicability and optimizations of Value classes, **but they require MFVC to be already implemented** for that. Their importance is caused by frequent usage of containers that store and use stored values: they are currently handle value classes as boxed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of other important steps of Value classes feature are Value arrays (`VArray`s) and reified classes and reified not-inline functions. They significantly extend applicability and optimizations of Value classes, **but they require MFVC to be already implemented** for that. Their importance is caused by frequent usage of containers that store and use stored values: they are currently handle value classes as boxed. | |
One of other important steps of Value classes feature are Value arrays (`VArray`s) and reified classes and reified not-inline functions. They significantly extend applicability and optimizations of Value classes, **but they require MFVC to be already implemented** for that. Their importance is caused by frequent usage of containers that store and use stored values: they currently handle value classes as boxed. |
An example of reified class will be helpful to understand why they require MFVC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean that impact(mfvc + varrays) > impact(mfvc) + impact(varrays)
because it also includes VArray<MFVC>
s. I don't know how to formulate it properly.
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
Co-authored-by: Ilmir Usmanov <me@ilmir.us>
There is another use-case I would like to share: Here: There I'm doing black magic tricks that are really dirty to avoid allocations, and the code looks ugly. Being able to have something like: value class MyPointer(val buffer: Buffer, val offset: Int) {
var x: Double get() = buffer.getDouble(0); set(value) { buffer.setDouble(0, value) }
var y: Double get() = buffer.getDouble(8); set(value) { buffer.setDouble(8, value) }
} That would help to have C-like pointers: an |
Co-authored-by: Sergei Bulgakov <servbul@yandex.ru>
No description provided.