[SERVER-2637] Optimize spheredist_rad function present in db/geo/core.h Created: 28/Feb/11 Updated: 12/Jul/16 Resolved: 14/Jan/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 1.8.0-rc0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Matteo Muratori | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
https://github.com/mongodb/mongo/blob/master/db/geo/core.h The function spheredist_rad can be optimized in two ways: 1) use a faster (but correct) formula: take a loook to http://www.movable-type.co.uk/scripts/latlong.html 2) then use a function that calculate sin and cos at the same time (saving in this way half of trigonometric functions): for example on x86/x86_64 there are several options (standard fsincos assembly function, SSE2 optimizations) |
| Comments |
| Comment by hari.khalsa@10gen.com [ 14/Jan/13 ] |
|
There is a new index type forthcoming, 2dsphere, that handles spherical indexing better. |