-
Notifications
You must be signed in to change notification settings - Fork 70
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
Reuse Bucket and Botocore objects to prevent cyclic references #112
Conversation
Hi, and thanks for contributing :) |
@kkopachev given I've merged the MAX_RETRY pull request, this one presents conflicts. I'd rather only publish one version with both fixes if that's ok with you? |
@Bladrak that's totally fine with me releasing in one shot. I'll rebase this PR. |
c73bd00
to
55330eb
Compare
@Bladrak rebased on top of latest master, but discovered that thumbor for each request creates new storage/result storage instance, which ruins the whole idea 😞 |
I'm not familiar with the global registry, is this handled by tornado? |
sorry, being busy lately. |
@Bladrak I think this is ready. CircleCI issue seems unrelated to code changes, but rather CI config itself. Tests are passing locally. In short, |
LGTM, I'm trying to have the tests pass before merging. Do you have some metrics about the improvements of GC? |
@kkopachev could you rebase against master to use latest CI workflow? This should hopefully stabilize your PR :) |
all green now! |
FYI, I have a counterpart PR opened on botocore repo boto/botocore#1450 which supposed to fix circularly referenced objects creation on each request. |
Great thanks! I'll try to publish a new version today |
calling
Botocore
on each call to loader/storage seems expensive, given thattornado_botocore
object then createsclient
object, which has a bunch of cyclically referenced objects inside. About 1-2k of objects total. Eventually they are getting garbage collected, but why bother running expensive gc, when reusing same objects can improve things.This PR essentially implementing ideas I outlined in #109. Collected garbage went down from 1600-1700 objects to 34 on each call to loader.
@Bladrak thoughts?
closes #109