I solved the problem of slow booting. When I saw the boot messages it showed me that a startup process is running my dev mapper. I checked the /etc/fstab and there was a swapfile indicating /swapfile but I checked using free -m that I didn't have a swap set up. So I set up a swap but still the problem remained unchanged. The actual problem was that there was an unexisting drive listed on the /etc/crypttab which was causing the issue. I commented out the line and now it boots fine.
So if you have starup job slow boot issue, please do check:
Do you have a swap? Check it using sudo swapon -s
Check whether the swap is listed in fstab properly. Also check whether there are any other unexisted device listed. If there is, comment it out by putting # and a space at the starting of the line.
If step 1 and 2 fails or not relevant then check whether any unexisted device listed on /etc/crypttab. If there is, comment it out.