IF you happen to have WiFi - that is a VERY common contributor to DPC Latency spikes, which can really cause audio streaming performance problems. Laptop owners who have Sonar often eliminate this issue by turning off their WiFi adapter (sometimes a switch or function key), or they will go into Windows Device Manager and disable the WiFi adapter there, JUST prior to launching their Sonar session.
Then, when done with Sonar, they will turn on or enable the WiFi again, and all is well.
If the above does not apply, do these issues go away if you hit the letter 'E' on your computer keyboard? (This is a hot key that will cause all effects to be bypassed). IF the issues go away at that point, then one or more of your loaded effects is likely not meant to be used during recording, but is more meant for the mixing/mastering end of things.
If the above doesn't work - check your driver mode, and likely you will want to be using ASIO, but this is not always true - some folks have reported better performance/sound using WDM instead, but it seems that number of folks is fairly small. (I have not seen very many folks indicate this over quite a few years). Also make sure even if you are using ASIO that it is not perhaps picking up the ASIO drivers from something like ASIO4ALL. IF you have ASIO4ALL installed on your computer - I recommend you take it out back and flog it to within an inch of its life, since you have the ASIO drivers for your actual audio interface to use instead. Truly, IF ASIO4ALL is installed, I DO suggest you actually do an uninstall of it and make sure it is gone.
I hope something in the above is of help - please review and respond when you get a chance. The earlier comment about the Prepare Using nnn Buffers suggestion is also a good one, AND it would help us all out to better help you if you modified your Forum Member Profile Signature to add in your computer specs, like you see at the bottom of my posts or others in the forum. When you DO add that info - make sure to check the box that tells the forum software to always attach your signature to your posts, or it still won't display.
THANKS,
Bob Bone