coen-hyde / Shanty-Mongo

Shanty Mongo is a mongodb library for the Zend Framework. Its intention is to make working with mongodb documents as natural and as simple as possible. In particular allowing embedded documents to also have custom document classes.
Other
200 stars 52 forks source link

Replace getValidators and getFilters code with single loadRequirements function. #60

Closed jwpage closed 12 years ago

jwpage commented 12 years ago

The getValidators and getFilters code does the same thing twice, and we're doubling the time required to run this code given that both functions were called in setProperty.

This commit gets around this problem by creating a single function loadRequirements, while maintaining the public API, and also lets us do a bit of extra caching at the same time.

Thoughts?

gwagner commented 12 years ago

jwpage I have pulled your changes into my branch at https://github.com/gwagner/Shanty-Mongo

These changes are too good to go un-merged so i am going to start managing pulls from my form and we can get the pushed upstream later once coen-hyde has time to get back to them.