KEMBAR78
Rust enums validator by samuelcolvin · Pull Request #1235 · pydantic/pydantic-core · GitHub
Skip to content

Conversation

@samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Mar 19, 2024

Change Summary

Enum validation in rust, gives a nice >4x speedup.

image

Still to do:

  • floats
  • serialization

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 19, 2024

CodSpeed Performance Report

Merging #1235 will not alter performance

Comparing enum-validator (770e436) with main (abff9ba)

Summary

✅ 148 untouched benchmarks

🆕 4 new benchmarks

Benchmarks breakdown

Benchmark main enum-validator Change
🆕 test_enum_int_core N/A 20.4 µs N/A
🆕 test_enum_int_python N/A 39 µs N/A
🆕 test_enum_str_core N/A 21 µs N/A
🆕 test_enum_str_python N/A 38.7 µs N/A

@samuelcolvin samuelcolvin changed the title custom enums validator Rust enums validator Mar 19, 2024
Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, no changes needed just passing thoughts!

davidhewitt pushed a commit to pydantic/pydantic that referenced this pull request Oct 20, 2025
davidhewitt pushed a commit to pydantic/pydantic that referenced this pull request Oct 22, 2025
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