airbnb / DeepLinkDispatch

A simple, annotation-based library for making deep link handling better on Android
http://nerds.airbnb.com/deeplinkdispatch/
4.37k stars 407 forks source link

Embed match info into index #312

Closed rossbacher closed 3 years ago

rossbacher commented 3 years ago

Embed match information into the match index. This way we do not need to codegen all the DeepLinkEntry constructions into the generated DeepLinkRegistry classes.

This change will create the DeepLinkEntry object on the fly with data that is stored inside the index (vs just an id stored in the index that was used to look up the DeepLinkEntry).

For this the matchId entry was removed from the match index and a new entry which contains the deeplink url template, the class the deeplink is registered in as well as the method to call on that class (if not a class level deeplink) was added.

This leads to 5x speed improvement in index initialization (in our example with 2000 deeplinks index init went from ~12ms down to ~2 ms.

This will also remove the upper boundary for handled deeplinks from DLD as the number of generated DeepLinkEntry constructor calls can lead to the Registry classes not being compilable anymore.