GIVE IT A WHIRL

Can anyone tell me the origins of the phrase GIVE IT A WHIRL?

It's late 19th century American. I have always assumed it refers to spinning a roulette wheel, a "wheel-of-fortune" or similar device.

I think it is linked to the colonial toy the Whirlygig. A stick with a propellor attached which you launch by spinning the stick between two hands, or by "giving it a whirl"