remove request deduplication from DefaultFileSource - #2826
Conversation
|
it's rare when using a single map view, but as soon as we're having two map views, duplicate requests are pretty common, in particular for shared resources like styles, sprites and glyphs. @jfirebaugh There's actually little complexity that is specific to deduping requests. We have to keep the Request objects around anyway because we're setting timers for retrying requests. |
|
@kkaefer We're not doing any cross-view request deduplication currently; both iOS and Android create a separate |
|
I tried triggering the coalescing code path in the OS X and linux apps by wild panning and zooming, fast switching between styles, and combinations of the two, and couldn't trigger it. It looks to me like it is effectively dead code. The only case I can imagine triggering it in is if you load a style that has duplicate sources pointing to the same tile URLs. Removing it will save ~75 lines of code (~17%) and significant complexity from |
Fair enough, let's remove it. If we find that this causes duplicate requests, in particular when using one FileSource for multiple map views, we can always consider adding it back in the future. However, it looks like we don't currently have that use case. |
Deduplicating concurrent requests for the same URL adds complexity to the implementation, but it's probably very rare for the exact same URL to be requested twice at the same moment.