-
Notifications
You must be signed in to change notification settings - Fork 1
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
[WIP] Extract vec without specialization #1
Conversation
374a2c2
to
9d0c291
Compare
I've come round to a design which is looking a lot cleaner. However, it still doesn't work for all types. The next step is probably to force implementations of |
Thank you for your try to remove specialization here. We use specialization here to use fast buffer protocol when it's applicable. In addition: I haven't checked all implementation details... but do we really want to have some specific markers like |
Not particularly, no. With this design I'm settling towards we may actually be able to remove |
Another option I've considered: given this is just an optimisation, we could just disable this optimisation if compiling on stable Rust? |
(close and reopen was an accidental fat finger error) |
I think it's OK since rust-numpy is always faster and better as buffer, though we can select some other choices...(e.g, implement |
541d875
to
fdf407e
Compare
This prototype implements use of Py<BaseException> as the instance to use for exception instances. These instances integrate reasonably well with the Rust’s standard error mechanisms by implementing the `Display` and `Error` traits. These error types can also be stored into e.g. `failure::Fail`s or other error types as a cause of some greater error.
This prototype implements use of Py<BaseException> as the instance to use for exception instances. These instances integrate reasonably well with the Rust’s standard error mechanisms by implementing the `Display` and `Error` traits. These error types can also be stored into e.g. `failure::Fail`s or other error types as a cause of some greater error.
This prototype implements use of Py<BaseException> as the instance to use for exception instances. These instances integrate reasonably well with the Rust’s standard error mechanisms by implementing the `Display` and `Error` traits. These error types can also be stored into e.g. `failure::Fail`s or other error types as a cause of some greater error.
This prototype implements use of Py<BaseException> as the instance to use for exception instances. These instances integrate reasonably well with the Rust’s standard error mechanisms by implementing the `Display` and `Error` traits. These error types can also be stored into e.g. `failure::Fail`s or other error types as a cause of some greater error.
This prototype implements use of Py<BaseException> as the instance to use for exception instances. These instances integrate reasonably well with the Rust’s standard error mechanisms by implementing the `Display` and `Error` traits. These error types can also be stored into e.g. `failure::Fail`s or other error types as a cause of some greater error.
In pyca/cryptography this function is the #1 source of lines of generated LLVM IR, because it is duplicated 42x (and growing!). By rewriting it so most of the logic is monomorphic, we reduce the generated LLVM IR for this function by 4x.
In pyca/cryptography this function is the #1 source of lines of generated LLVM IR, because it is duplicated 42x (and growing!). By rewriting it so most of the logic is monomorphic, we reduce the generated LLVM IR for this function by 4x.
* Mappingproxy (#1) Adds in the MappingProxy type. * Move over from `iter` to `try_iter`. * Added lifetime to `try_iter`, preventing need to clone when iterating. * Remove unneccessary borrow. * Add newsfragment * Newline to newsfragment. * Remove explicit lifetime, * Review comments (#2) * Addressing more comments * Remove extract_bound. * Remove extract methods. * Update comments for list return type. --------- Co-authored-by: Kevin Matlock <kevin.matlock@omicsautomation.com>
* Mappingproxy (#1) Adds in the MappingProxy type. * Move over from `iter` to `try_iter`. * Added lifetime to `try_iter`, preventing need to clone when iterating. * Remove unneccessary borrow. * Add newsfragment * Newline to newsfragment. * Remove explicit lifetime, * Review comments (#2) * Addressing more comments * Remove extract_bound. * Remove extract methods. * Update mapping to return PyList instead of Sequence. * Update comments for list return type. * Add newfragment. * Reimpliment copy with PyMapping type. * Trigger Build --------- Co-authored-by: Kevin Matlock <kevin.matlock@omicsautomation.com>
Attempt to implement
FromPyObject
forVec<T>
with a buffer optimisation, without specialisation.Can't merge because:
In this new design,
FromPyObject
forVec<String>
is not currently implemented, butFromPyObject
forString
is. In general this is a problem for all types which implementFromPyObject
instead ofFromPyObjectImpl
.Probably the solution is to make it ergonomic to implement
FromPyObjectImpl
directly for all types.