Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Performance #88

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Performance #88

wants to merge 17 commits into from

Conversation

ThomasJunk
Copy link
Member

@ThomasJunk ThomasJunk commented Aug 26, 2017

Proposal of using vars to serialize an objects instance instead of hopping over SQL-Alchemy propertier. From the first sight it seams to do the trick. Perhaps you should take this into consideration or maybe tweak it a little bit to suit your needs.
Overall it brought 0.5s (on my laptop) which could matter.

32fb517

is only relevant

@ThomasJunk
Copy link
Member Author

Note to the failing test: There could be a filtering implemented to clean the exports of unnecessary fields. The general serialization would be improved. So the cost of a filter is low.

@toirl
Copy link
Member

toirl commented Aug 29, 2017

You mean 0,5 secs per call of get_values? Or 0,5 sec in total of a more complex request? So what is the estimated gain per call?

@ThomasJunk
Copy link
Member Author

To put it in a more general context:
To retrieve (many/all) values from a SQLAlchemy object, I found it cheaper to read from its __dict__ (via vars()) than to use the dotnotation.

Measurably it increased the performance for 2k full fledged Instances of Businessobjects with several dependend Objects (which add up to about 8k-10k) Objects.

If you read only the ready resultset, this is the faster way.

It comes at the cost, that you perhaps get more than you intended.

@ThomasJunk
Copy link
Member Author

But as I said, this is in draft stage and proposed for further consideration.

@toirl
Copy link
Member

toirl commented Aug 29, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants