RussBaz / enforce

Python 3.5+ runtime type checking for integration testing and data validation
542 stars 21 forks source link

Profiling #18

Open TheDataLeek opened 8 years ago

TheDataLeek commented 8 years ago

What are the performance considerations for users wishing to use this in a production environment?

RussBaz commented 8 years ago

For now - Lists. Because they are fully evaluated before running the function, their performance will remain terrible till we switch to lazy evaluation of them.

I don't think there should be any other major performance problems.

TheDataLeek commented 8 years ago

Yeah, that definitely is true for any iterable thing (except generators). Cause right now if you have a deep nested iterable thing, it will evaluate the entire structure beforehand...

I'm planning on making a new repo for profiling this. I'll keep you updated for the results.

RussBaz commented 8 years ago

Sure, thanks.

kevinboulain commented 7 years ago

FYI, typeguard is checking the __debug__ constant, it could be nice to do the same here.