Rapidly accessing collection through singleton vs direct reference
<p>I have a collection that is defined in instance of singleton, the collection is accesed constantly (million of times).</p>

<p>Right now I am adding values to collection through the singleton:</p>

<pre><code>DataRepository.getInstance().addToCollection(collectionId, value);
</code></pre>

<p>(In add collection method I first load the collection from hashmap by collectionId, and then add value to it)</p>

<p>Will I get any performance improvement if I load the instance of the collection and use the reference directly?</p>

<p>like:</p>

<pre><code>CustomCollection collection =  DataRepository.getInstance().getCollection(collectionId);
</code></pre>
