"a boastful and self-important person; a strutting little fellow.
If cockalorum suggests a crowing cock, that's because cockalorum probably comes from kockeloeren – an obsolete Dutch dialect verb meaning "to crow."
Obsolete it is not, but misspelled it is. We don't combine c with k in Dutch, that's a typically English combination. The Dutch word is koekeloeren, and it means to snoop, to peep, or simply standing somewhere in vain with nothing in particular to do waiting for something to happen. Which meaning might account a bit for the English adaptation.