RTP Jitter Buffer vs Sort Buffer

What’s the difference between the jitter buffer mentioned here
and the sort buffer mentioned here

I’ve noticed a correlation between cpu utilization and rtpDePacketizerPacketSorterFlushTime. A flush time of 10 uses significantly more cpu utilization than a flush time of 50. How does one determine the proper value for these parameters? What’s the effect of a larger or shorter flush interval?