I have a gif image. It gets shown only on very specific events, not too often. By default, the gif\'s html tag is hidden using
display: none
with display:none
elements still exist in, and are resolved by the browser, they are only hidden from the user.
you could use visible=false
as this elements are not resolved in the browser but I don't know if you can use it.
I would also check visibility: hidden
as I don't know for this option how is it rendered.
You can benchmark it the old school way, just jam up 50 (or more if necessary) gif's in your page, until your CPU spikes and than hide it and observe your CPU.
I would also point out that the behavior will heavily depend on the browser itself so you would need to check it with different browser to be really sure.