pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python-gino/gino/pull/797

pull-requests-be6017ec12798e73.css" /> Optimize columns loading: lazy create row locator by Reskov · Pull Request #797 · python-gino/gino · GitHub
Skip to content

Optimize columns loading: lazy create row locator - #797

Open
Reskov wants to merge 1 commit into
python-gino:masterfrom
Reskov:lazy-locator
Open

Optimize columns loading: lazy create row locator#797
Reskov wants to merge 1 commit into
python-gino:masterfrom
Reskov:lazy-locator

Conversation

@Reskov

@Reskov Reskov commented Oct 10, 2021

Copy link
Copy Markdown

Locator instance builds unnecessary query for each row when the model is loaded from a database, to my mind, it is better to create an instance of the locator/UpdateRequest lazily (only if some values are passed to the model)

Here are the results of the benchmarks for loading 20000 rows, from my previous PR

#786 (comment)

before

CPU time: 0.55 s, Real time: 0.56 s

Single column loader
CPU time: 0.33 s, Real time: 0.33 s

Partial loader
CPU time: 0.45 s, Real time: 0.45 s

after

CPU time: 0.20 s, Real time: 0.20 s
Single column loader
CPU time: 0.04 s, Real time: 0.04 s
Partial loader
CPU time: 0.15 s, Real time: 0.15 s

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

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy