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

Cache when there is no metadata for a class #36

Merged

Conversation

adrienbrault
Copy link
Contributor

What this changes:

  • In debug, the factory will try to load the metadata of a class only once (per request) if there is none, instead of multiple times
  • In debug=false, the factory will try to load the metadata of a class only once until the cache is cleared (among multiple requests)

There should be way less file_exists going on :)

@adrienbrault
Copy link
Contributor Author

FYI benchmarking with a vagrant box an api endpoint serializing thousands of objects:

enabled disabled
dev 2.8s 5.7s
prod 2.4s 5.6s

@schmittjoh I know that the patch isnt sexy but WDYT ?

@schmittjoh
Copy link
Owner

I wasn't really sure whether it was worth it when I saw it, and then I more or less forgot this PR.

We will probably need to refactor the factory soon, but I'll merge this now as the improvement seems to be quite significant for some systems as you pointed out.

schmittjoh added a commit that referenced this pull request Oct 24, 2013
Cache when there is no metadata for a class
@schmittjoh schmittjoh merged commit 5e7b07a into schmittjoh:master Oct 24, 2013
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.

None yet

2 participants