#3717 closed defect (fixed)
Optimize range queries
Reported by: | mimo | Owned by: | mimo |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 20 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description
Most of the time used by range queries is spent sorting (by id) entities which are in range, before checking that they fulfill the query requirements. Doing the sort after the filter drastically improves the performance. On a non visual replay with 2000 turns, Valgrind quotes 6.9% spent in PerformQuery before the fix, which is reduced to 4.0% with the patch.
Attachments (2)
Change History (7)
by , 8 years ago
Attachment: | fastSpatial.patch added |
---|
by , 8 years ago
Attachment: | commands-tutorial.txt added |
---|
commands.txt used for the profile, for reference
comment:2 by , 8 years ago
Thanks fabio for the checks. I don't understand how the changes in the code could explain the differences in the spikes at 330 and 600. Could you rerun your profiles to check that these are reproducibles ?
comment:3 by , 8 years ago
comment:5 by , 8 years ago
Keywords: | review removed |
---|
Note:
See TracTickets
for help on using tickets.
I tested this patch against r17566, here is the graph of total time while replaying (simulation, not visual) the tutorial, the improvement is noticeable (although a couple peaks are slower). I also added for reference a19, it is faster than svn but has a different final hash, so probably not directly comparable. EDIT: ignore a19, the visual replay is indeed completely different.