Search code examples
androidbutterknife

Does the use of ButterKnife make app slower?


I've started to use ButterKnife in my android app just to see the difference between it and "findViewById", what I found was that the UI is sort of sluggish and there's a small lag when I open an activity or fragment. Does ButterKnife create this small lag?


Solution

  • No it doesn't. Let's check what id does behind the scenes. It uses annotation interface, to make the same things, difference only in compile time, when you cache of built files is empty.

    Each Bind annotation do the same with usual finding View, with id, and saving to the local view id's collections. It's very simple, because nothing special there. Just check custom interface implementation, you can implement simple Butterknife by yourself.