Replies: 1 comment 1 reply
-
Note that when talking about performance, it's always a good idea to actually measure it and provide numbers. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
With pyo3 I could get a class named Account and Market in python, and also do
market.call_func()
ormarket.account.call_acc_func()
.Py::as_ref, to borrow a GIL-bound reference to the contained object.
Py::borrow, Py::try_borrow, Py::borrow_mut, or Py::try_borrow_mut, to get a (mutable) reference to a contained pyclass, using a scheme similar to std's [RefCell].
What I wonder is that if use the struct
Market
in rust and callself.account.borrow_mut().some_acc_func()
, would it get the same performance like aMarketPure
callself.account.some_acc_func()
? The gil is no need to concern when[pyclass]
is used in rust code?Beta Was this translation helpful? Give feedback.
All reactions