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

some more optimizations for add_field #55

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

Conversation

wchristian
Copy link
Contributor

These combine with #54

15-05-11@16:58:43
(ribasushi) just optimize for "minimal logical diff", and
            ignore the urge to "strive for elegance"
Getting the names of fields is only needed when adding a field with a
pre-determined order value. For all other cases that is wasted time.
The code that determines/checks the value of order for the new field needs
all existing fields, but does not depend on their order at all, thus
switching from get_fields to _fields speeds things up a bit.
@wchristian
Copy link
Contributor Author

IIRC the gains were substantial, provided the table is large enough. To get actual numbers i'd need to look up the actual case though. Pleanning to get around to that next week.

What exactly does double-digit gain mean?

As for the duplicate thing, i think it'll be best if i simply make a test for it and have it retain behavior on that. I think it'll be possible to get both that, and the speed-up.

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

Successfully merging this pull request may close these issues.

None yet

2 participants