Sharing Resource between clients

Hello

Introduction:
I have application which contains e.g. 100 small icons. These icons are provided for clients (users) using new ThemeResource( “path/to/icon.png” ).

Idea:
Because icons are static and the same for all users all the time the application is working, I want to save some memory by sharing these icons between clients so in memory I will have only 100xThemeResources for all logged users instead of having 100xThemeResources for every single user. I already did some “investigations” with sharing icons and it looks like it is working.

Doubts:
Because “Early optimization is root of all evil” I have question to You:

  • Is it really worth of saving memory?
  • Is it already implemented in Vaadin and I didn’t spot it yet? (some ResourceManager?)
  • Are there any problems with sharing resources as above? No problems with belonging one icon to many Components?

Thanx in advance for given ideas and solutions.