mkremins / fanciful

Fancy Bukkit message formatting
MIT License
95 stars 82 forks source link

Cache reflection instances as local variables #24

Closed mkremins closed 10 years ago

mkremins commented 10 years ago

Copied from @glen3b's comment on commit 62978b7:

Cache the reflection instances (the Method instances, the Field instances, etc) as local variables: Better to avoid expenses you don't need with each call and only do them once (I use a similiar approach for fields in my library: a lazily initialized global field cache.