rez icon indicating copy to clipboard operation
rez copied to clipboard

Replace the version API with Rust

Open scott-wilson opened this issue 3 years ago • 11 comments

Increase solver speed by porting the version submodule to Rust.

src/rez/vendor/version/

Conditions:

Rust implementation must benchmark faster than equivalent Python resolve in most cases Python implementation must remain available. Rust is optional. Rust implementation should be written to allow easy porting/addition of other portions of rez in Rust. Build process and code should be documented, targeting those who are unfamiliar with Rust Rust code must contain passing unittests Rust code must pass the existing Python test suite. Rust code must have the rez license at the top of each file

scott-wilson avatar Feb 11 '22 06:02 scott-wilson

Just a note on this - if at all possible it'd be good to keep some form of --no-rust rez install option available (and great if this could translate to an extra for the rez pip package). Rez is very backwards compatible by design and I'd hate to introduce a new requirement that studios may not be ready to meet.

In the same vein, we should keep both the py- and rust- based version submods present - perhaps making rust available via import of rversion rather than version, and choosing between them in rez based on availability. We'd also then run the same unit test over rversion as we do version already.

I'm noting this stuff now (even though we're so early in) so we're thinking about it earlier on and hopefully avoiding more work later.

nerdvegas avatar Feb 11 '22 21:02 nerdvegas

Also want to make you aware of the benchmarking CI we already have. We'll probably have to tweak it to show rust numbers alongside py or something.

https://github.com/nerdvegas/rez/blob/master/metrics/benchmarking/RESULTS.md

nerdvegas avatar Feb 11 '22 21:02 nerdvegas

Hi @scott-wilson,

To @nerdvegas's point, it would be great to describe what this PR does and why. There is no description at the moment which is mildly surprising.

Cheers,

Thomas

KelSolaar avatar Feb 12 '22 22:02 KelSolaar

Hi @scott-wilson,

To @nerdvegas's point, it would be great to describe what this PR does and why. There is no description at the moment which is mildly surprising.

Cheers,

Thomas

That's fair. I am mostly just getting something done before I turn this into a proper PR.

scott-wilson avatar Feb 13 '22 02:02 scott-wilson

Hi @scott-wilson,

To @nerdvegas's point, it would be great to describe what this PR does and why. There is no description at the moment which is mildly surprising.

Cheers,

Thomas

Here's an initial take at the PR description.


Increase solver speed by porting the version submodule to Rust.

src/rez/vendor/version/

Conditions:

  1. Rust implementation must benchmark faster than equivalent Python resolve in most cases
  2. Python implementation must remain available. Rust is optional.
  3. Rust implementation should be written to allow easy porting/addition of other portions of rez in Rust.
  4. Build process and code should be documented, targeting those who are unfamiliar with Rust
  5. Rust code must contain passing unittests
  6. Rust code must pass the existing Python test suite.
  7. Rust code must have the rez license at the top of each file

sirfuzzalot avatar Feb 21 '22 17:02 sirfuzzalot

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Feb 27 '22 03:02 sonarqubecloud[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar May 06 '22 01:05 sonarqubecloud[bot]

I know this is a bit old now but I'm wondering what kind of performance increase was coming out of this? As our Rez repos are increasing in size resolves are getting slower and slower so I'm curious about anything that could speed it up at this point.

herronelou avatar Feb 21 '23 18:02 herronelou

I know this is a bit old now but I'm wondering what kind of performance increase was coming out of this? As our Rez repos are increasing in size resolves are getting slower and slower so I'm curious about anything that could speed it up at this point.

Are you running memcached? We hardly see any performance issue with the solver with memcached.

instinct-vfx avatar Feb 21 '23 18:02 instinct-vfx

I know this is a bit old now but I'm wondering what kind of performance increase was coming out of this? As our Rez repos are increasing in size resolves are getting slower and slower so I'm curious about anything that could speed it up at this point.

Are you running memcached? We hardly see any performance issue with the solver with memcached.

That's likely derailing the thread a little bit, but no, right now cache was disabled because we had issues with the resolve not always grabbing the latest versions if it has old stuff cached already. If you or someone else has time for a chat I'd love to go through our setup to see if there are things we could do to speed it up.

herronelou avatar Feb 21 '23 18:02 herronelou

You may want to jump onto the Slack if you can, that will give perspective and support by multiple parties

instinct-vfx avatar Feb 21 '23 18:02 instinct-vfx