Here is a performance comparison grpah based on total muzzle energy (chemical + kinetic) of the guns in question.
This graph covers machine guns and "light" cannon, meaning that cannon up to 23 mm are included and - as single exception - the 37 mm M4 (as used in the Bell P-39 Airacobra) as well because it's poor performance puts it right into the middle of this graph.
Total muzzle energy is based on typical beltings, as far as I could determine what these were. For the 12.7 mm Browning, I have used a pure armour-piercing incendiary loadout.
Guns for which I did not have exact data for the weight of cartridges including belting and thus made a guess at the weight of the belting are indicated by italic names. Guns for which I didn't attempt to make a guess at the weight of the belting and for which the weight data thus probably has to be considered optimistic are indicated by italics in brackets.
The total weight for determining firepower per weight is based on the amount of ammunition equivalent in total energy to 350 rounds of 12.7 mm Browning armour-piercing incendiary ammunition (since this is a typical load-out for aircraft armed with this gun).
Colour coding of the disks is chosen to show nationality of the gun. Colour of the gun designations is chosen for readibility and doesn't code anything.
Any additional data on the guns indicated by italics would be highly welcome! :-)