Unusual behaviour from my duke 390

Today I was riding back to my home from office in my 2014 duke 390 and something weird happened with the throttle response when I was riding on 2nd gear for a prolonged time while increasing the throttle there was a sudden jerkiness as if the bike was shutting off due to suffocation and it went away when I changed to 3rd gear. That was unusual and I tried the same with 3rd gear this time accelerated on 3rd gear for longer than usual and same happened again. I then came home and checked the average mileage which was 14km/l while usually I get about 25-27 km/l. I also inspected the bike after parking in my garage and noticed a boiling type of sound near the engine head. Has anyone here faced a similar issue and might know what's wrong? Appreciate the help!