I developed a Java module that checks if any component on a JFrame form has changed its value(text) and puts the component it into a HashSet for the JFrame. 

Currently, I put the component name(String type) into the HashSet when its value/text changed.

I have a second thought that if I put Object(the component with changed value) into the HashSet thinking it might save time compared to using component name(String).

Here, my question is which is faster/efficent between

* using String(component's name) to HashSet, or
* using Object(component itself) to HashSet?

In short, maybe, which is cheaper? String comparision or Object comparision?

Thank you,

JB