Skip to content

Conversation

@Reskov
Copy link

@Reskov Reskov commented Oct 10, 2021

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

1 participant