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

Update PyO3 to 0.16 and to Rust stable channel #18

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

rchildre3
Copy link
Contributor

Addresses #17 and #11

@rchildre3
Copy link
Contributor Author

Seeing a large regression on benchmarks on my box:

lsb_release -a
#No LSB modules are available.
#Distributor ID:	Ubuntu
#Description:	Ubuntu 21.10
#Release:	21.10
#Codename:	impish
uname -a
#Linux hostname 5.13.0-30-generic #33-Ubuntu SMP Fri Feb 4 17:03:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
cat /proc/cpuinfo
#model name      : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
#siblings        : 4
#cpu cores       : 2
python3 -VV
#Python 3.9.7 (default, Sep 10 2021, 14:59:43) 
#[GCC 11.2.0]
python3 -m venv ./.venv
. ./.venv/bin/activate
pip install maturin tox
rm -r target
maturin build --no-sdist --release --strip -i python3
tox
-------------------------------------------------------------------------------- benchmark 'parse-bytes': 2 tests -------------------------------------------------------------------------------
Name (time in us)                Min                Max              Mean            StdDev            Median               IQR              Outliers  OPS (Kops/s)            Rounds  Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_parse_bytes_uuid         1.2150 (1.0)      38.5570 (1.0)      1.4261 (1.0)      0.9790 (1.0)      1.2850 (1.0)      0.0490 (1.0)      4012;14871      701.2219 (1.0)      118977           1
test_parse_bytes_fastuuid     4.6490 (3.83)     45.9060 (1.19)     6.0721 (4.26)     2.8876 (2.95)     4.8880 (3.80)     0.7170 (14.63)     1744;3255      164.6872 (0.23)      15675           1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------- benchmark 'parse-bytes_le': 2 tests --------------------------------------------------------------------------------
Name (time in us)                   Min                 Max              Mean            StdDev            Median               IQR              Outliers  OPS (Kops/s)            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_parse_bytes_le_uuid         1.7220 (1.0)       61.4320 (1.0)      2.0211 (1.0)      1.2576 (1.0)      1.8170 (1.0)      0.0690 (1.0)      3898;15633      494.7810 (1.0)      109219           1
test_parse_bytes_le_fastuuid     5.7240 (3.32)     119.1090 (1.94)     6.6473 (3.29)     2.7640 (2.20)     5.9880 (3.30)     0.2280 (3.30)      1252;3231      150.4381 (0.30)      20146           1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------- benchmark 'parse-fields': 2 tests --------------------------------------------------------------------------------
Name (time in us)                 Min                Max              Mean            StdDev            Median               IQR              Outliers  OPS (Kops/s)            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_parse_fields_uuid         1.7250 (1.0)      52.1830 (1.0)      2.0304 (1.0)      1.2770 (1.0)      1.8050 (1.0)      0.0650 (1.0)      5561;15965      492.5083 (1.0)      116782           1
test_parse_fields_fastuuid     6.5190 (3.78)     78.0640 (1.50)     7.6877 (3.79)     3.1784 (2.49)     6.8125 (3.77)     0.2970 (4.57)      1547;2988      130.0771 (0.26)      19526           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------- benchmark 'parse-hex': 2 tests ------------------------------------------------------------------------------
Name (time in us)              Min                Max              Mean            StdDev            Median               IQR            Outliers  OPS (Kops/s)            Rounds  Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_parse_hex_uuid         1.5560 (1.0)      42.2360 (1.0)      1.7721 (1.0)      1.1177 (1.0)      1.6240 (1.0)      0.0460 (1.0)     1249;5101      564.3028 (1.0)       42842           1
test_parse_hex_fastuuid     7.5400 (4.85)     54.8400 (1.30)     8.8760 (5.01)     3.3834 (3.03)     7.8510 (4.83)     0.3770 (8.20)     816;1568      112.6627 (0.20)       9835           1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@thedrow
Copy link
Collaborator

thedrow commented Mar 1, 2022

Is this because of the stable rust version or because of the PyO3 version upgrade?

@rchildre3
Copy link
Contributor Author

Is this because of the stable rust version or because of the PyO3 version upgrade?

Actually seeing similar regressions back on master branch. Maybe the regression is just my machine, do you see the same results?

@thedrow
Copy link
Collaborator

thedrow commented Mar 1, 2022

Is this because of the stable rust version or because of the PyO3 version upgrade?

Actually seeing similar regressions back on master branch. Maybe the regression is just my machine, do you see the same results?

The previous benchmark runs were on i7. I'll give it a shot now.

@thedrow
Copy link
Collaborator

thedrow commented Mar 3, 2022

I ran the benchmarks and everything's fine.
When you compile a PyO3 extension in non-optimized mode, it tends to be very slow.
If you did this with tox, you'd get a debug build because with tox we just check that the benchmarks work right now.

@rchildre3
Copy link
Contributor Author

When you compile a PyO3 extension in non-optimized mode, it tends to be very slow.

I was under the impression that the maturin build --release that I ran would make tox use the optimized version?

Potential other tasks to close this PR

  • Regenerate benchmarks?
  • Include script such that benchmarks can be easily reproduced?
  • Version bump?

@thedrow
Copy link
Collaborator

thedrow commented Mar 8, 2022

The problem with reproducible benchmarks is that we only have VMs.
VMs are not reliable for measuring performance. See here and here

We can use https://github.com/marketplace/actions/continuous-benchmark to track the benchmarks results.

I think we can bump the version and tag.
Would you like an invite to this repository?

@rchildre3
Copy link
Contributor Author

The idea of the a benchmarking github action is nice, and probably fitting, but should be its own, separate pull request

Will bump version in Cargo.toml but would prefer git taging stay with the main author.
Would 0.8.0 be appropriate?

@thedrow
Copy link
Collaborator

thedrow commented Mar 9, 2022

Yes. 0.8.0 would be appropriate.

@rchildre3 rchildre3 force-pushed the update-pyo3_016-stable-rust branch 3 times, most recently from 6a72cbb to c8baae5 Compare March 11, 2022 02:05
@rchildre3
Copy link
Contributor Author

added version bump with squash and rebase, manylinux2_24 job failing due to password, not sure for the fix?

@rchildre3 rchildre3 force-pushed the update-pyo3_016-stable-rust branch 2 times, most recently from 62668d8 to b83ada6 Compare March 11, 2022 02:24
* Move to Rust stable channel by default
* Small fix for PyTuple indexing
* rusfmt'd and clippy'd
* Remove support for 3.6 and add support for 3.10.
* Bump version 0.7.0 -> 0.8.0
@rchildre3
Copy link
Contributor Author

resolved by backing out manylinux changes

@rchildre3
Copy link
Contributor Author

would any other changes be required for this PR to be merged in?

@thedrow thedrow merged commit a017457 into fastuuid:master Mar 23, 2022
@thedrow
Copy link
Collaborator

thedrow commented Mar 23, 2022

No. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build with Rust stable and updated PyO3 bindings Create a first release with stable
2 participants