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

refactor: parsing of constraints #254

Merged
merged 25 commits into from
Jul 10, 2023

Conversation

baszalmstra
Copy link
Collaborator

Refactors the parsing of constraints (e.g. >3.1, 2.*). I also had to refactor the version parser a little bit to ensure it properly handles a version followed by .* or *. The goal of these refactors is to improve performance, provide better error messages and create a unified parser for all data types instead of partly regex, nom, and string matching.

@baszalmstra baszalmstra requested a review from wolfv July 8, 2023 19:57
@wolfv
Copy link
Contributor

wolfv commented Jul 10, 2023

Here are my numbers (although I have no reference, so idk if things are faster or slower :)

     Running benches/parse.rs (target/release/deps/parse-eb7c46bccb24a24c)
Gnuplot not found, using plotters backend
parse simple version    time:   [107.97 ns 108.18 ns 108.41 ns]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe

parse complex version   time:   [658.11 ns 659.37 ns 660.74 ns]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

parse logical constraint
                        time:   [44.256 ns 44.350 ns 44.462 ns]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

parse wildcard constraint
                        time:   [122.10 ns 122.78 ns 123.73 ns]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe

parse simple version spec
                        time:   [44.384 ns 44.486 ns 44.591 ns]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild

parse complex version spec
                        time:   [50.782 ns 51.106 ns 51.408 ns]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) low mild

     Running unittests src/lib.rs (target/release/deps/rattler_digest-ff3bfc03e5590ce1)

running 5 tests

@wolfv wolfv merged commit 177be0b into conda:main Jul 10, 2023
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.

2 participants