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

Optimization for redirects renderer #519

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

awmackowiak
Copy link
Contributor

@awmackowiak awmackowiak commented Oct 18, 2024

before optimalization
celery-worker-1       | INFO 2024-10-18 12:56:22,423 cluster 52 139647108794176 vcl reload phase prepare_redirects; calls: 6. time: 2.2386739880000164
celery-worker-1       | INFO 2024-10-18 12:56:30,358 cluster 52 139647108794176 vcl reload phase prepare_redirects; calls: 6. time: 5.5904893000000015
celery-worker-1       | INFO 2024-10-18 12:57:33,040 cluster 52 139647108794176 vcl reload phase prepare_redirects; calls: 6. time: 2.6580591449999247
celery-worker-1       | INFO 2024-10-18 12:57:44,697 cluster 52 139647108794176 vcl reload phase prepare_redirects; calls: 6. time: 4.161070299999949
celery-worker-1       | INFO 2024-10-18 12:57:57,406 cluster 52 139647108794176 vcl reload phase prepare_redirects; calls: 6. time: 4.290874630000019


after optimization
celery-worker-1       | INFO 2024-10-18 13:14:38,524 cluster 53 139865518655296 vcl reload phase prepare_redirects; calls: 6. time: 0.2146076199996969
celery-worker-1       | INFO 2024-10-18 13:14:49,105 cluster 53 139865518655296 vcl reload phase prepare_redirects; calls: 6. time: 0.35585081900012483
celery-worker-1       | INFO 2024-10-18 13:14:56,205 cluster 53 139865518655296 vcl reload phase prepare_redirects; calls: 6. time: 0.3160363699998925
celery-worker-1       | INFO 2024-10-18 13:15:06,983 cluster 53 139865518655296 vcl reload phase prepare_redirects; calls: 6. time: 0.3656563640004151
celery-worker-1       | INFO 2024-10-18 13:15:11,904 cluster 53 139865518655296 vcl reload phase prepare_redirects; calls: 6. time: 0.2807816019999336

mgolski added a commit that referenced this pull request Oct 21, 2024
Draft pull request: #519

This changes the iteration order during prepare_redirects (changing the loop from:
```for redirect in self.input.redirects:
   ...
       for mapped_domain in redirect.src_domain.mapped_domains(self.varnish.cluster):
```
to:
```for related_domain in related_domains:
   ...
       for redirect in self.input.redirects.get(related_domain):
       ...
          for mapped_domain in redirect.src_domain.mapped_domains(self.varnish.cluster):

```
In testing this caused a speedup in the time to prepare redirects from ~0.7 to ~0.1
mgolski added a commit that referenced this pull request Oct 21, 2024
Draft pull request: #519

This changes the iteration order during prepare_redirects (changing the loop from:
```for redirect in self.input.redirects:
   ...
       for mapped_domain in redirect.src_domain.mapped_domains(self.varnish.cluster):
```
to:
```for related_domain in related_domains:
   ...
       for redirect in self.input.redirects.get(related_domain):
       ...
          for mapped_domain in redirect.src_domain.mapped_domains(self.varnish.cluster):

```
In testing this caused a speedup in the time to prepare redirects from ~0.7 to ~0.1
mgolski added a commit that referenced this pull request Oct 21, 2024
Draft pull request: #519

This changes the iteration order during prepare_redirects (changing the loop from:
```for redirect in self.input.redirects:
   ...
       for mapped_domain in redirect.src_domain.mapped_domains(self.varnish.cluster):
```
to:
```for related_domain in related_domains:
   ...
       for redirect in self.input.redirects.get(related_domain):
       ...
          for mapped_domain in redirect.src_domain.mapped_domains(self.varnish.cluster):

```
In testing this caused a speedup in the time to prepare redirects from ~0.7 to ~0.1
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.

1 participant