6 ms·
Fantastic project, but if you're looking for speed this isn't it.
by oars 5y ago
Fantastic project, but if you're looking for speed this isn't it.
- bredren 5y agoWhat do you look to for a more balanced speed / feature set?
- Seirdy 5y agoA different language, most likely. I'd use Python for this if the work being done isn't too CPU-intensive and I can afford to make big tradeoffs. If you want to do data validation like this but for something with better performance while still retaining the benefits of a high-level GC'd language, then I'd try something like https://github.com/go-playground/validator https://github.com/go-playground/validator for Go.
- Attummm 5y agoTake a look at https://github.com/Attumm/Maat https://github.com/Attumm/Maat Maat is much faster then pydantic according to the benchmark of pydantic.
- johnwheeler 5y agoLooks atrocious from an ergonomics perspective. Who likes defining everything with python dictionaries over classes or type hints?
- mythrwy 5y agoPeople who want stuff to go fast?
- johnwheeler 5y agoOk, you go do that then
- Attummm 5y agoIts onlt recently that classes are embraced by python community. Before that dictionaries where seen as pythonic and classes where not. https://youtu.be/o9pEzgHorH0 https://youtu.be/o9pEzgHorH0
- Seirdy 5y agoChances are, if you've chosen Python for a new project today then you're willing to trade a lot of speed for developer convenience already.
- johnwheeler 5y agoWhy do you make such a blanket statement like that? According to the benchmarks page, it’s faster than its alternatives https://pydantic-docs.helpmanual.io/benchmarks/ https://pydantic-docs.helpmanual.io/benchmarks/
- Attummm 5y agoThe only reason it's rhe fastest is because they won't allow for other tools. https://github.com/samuelcolvin/pydantic/discussions/3094 https://github.com/samuelcolvin/pydantic/discussions/3094 Maat readme also shares that benchmark. Its way faster.
- johnwheeler 5y agoI don’t think they’ll consider your framework at this point because it doesn’t have enough mindshare. I don’t think they’re being unfair or blacklisting you. Also, your PR was very forward and assumptive IMO, “can I get an issue number” like you’re entitled to one. Get some more users (stars being a proxy for that), and I’m sure they’ll consider you if you ask with a little more humility. “Way faster” is a bit hyperbolic isn’t it? 2.5 times faster? That’s no order of magnitude. What validation use cases are there where it makes a difference? Very few. Here’s the thing: if people really want fast validation and transformation, they’re probably not going to use python. People use python for its developer ergonomics and experience. Dicts as a configuration DSL are inferior to classes and type hints for very simple reasons 1. One bad thing about python is that both single and double quotes are acceptable. Dicts are built with strings, so there’s an anxiety about having to standardize in one over the other that adds to cognitive overhead. 2. There are dict literals that get rid of one string, but again, just another “choice” people don’t care to make if they don’t have to 3. Curly brackets aren’t the easiest things to type relative to other characters. 4. Curly brackets are extremely difficult to pair if you don’t have an editor that does it automatically or if your code formatter puts many brackets on the same line. That’s pretty much it right there.
- Attummm 5y agoThere is no need for hostility. My comment was in your response of the benchmark that pydantic is fastest. In their own documentation they invite all other framework to send their results. That said what pydantic team does is up to them, the Maat was made before pydantic was a option, it has filled that usecase. The benchmark was only added because of a internal discussion about which tool to use. Engineering is about tradeoffs and each project will have own technical problems. Therefor there will never be the best solution, only the best solution for a particular problem within that context.