I was recently working with sparkles and came up with a solution which lets you make DOF effect on such kind of particles very quickly.
Ultimately, to mimic the DOF effect on sparkles, you only need to alter their size and transparency according to the distance to the camera. Performing this operation with a pCustom doesn't take any considerable time and defocused sparkles are being rendered as quickly as basic ones.
The only difficulty I experienced was I had to redefine all the size and color variation parameters in this very pCustom.
When you use size, r, g, b, a and other particle properties, you actually refer to these modified by the pCustom in the previous frame, which is sometimes just what you need, but in this case isn't desirable.
So, I was unable to just modify these properties because of the modifications accumulated from frame to frame.
It would be great if pCustom could refer to the original properties.