I have already checked some answers related to this. Nevertheless, I have not found a more specific answer to this question:
Let's assume I have this log from some query or data step I have done:
NOTE: DATA statement used (Total process time): real time 5:06.17 user cpu time 42.77 seconds system cpu time 1:31.09 memory 501.93k OS Memory 31640.00k Timestamp 27/08/2019 09:58:21 a.m. Step Count 13 Switch Count 504 Page Faults 0 Page Reclaims 2 Page Swaps 0 Voluntary Context Switches 6070 Involuntary Context Switches 17493 Block Input Operations 51217008 Block Output Operations 55055136
I always thought that real time (5:06.17) would be = user cpu time (42.77 seconds ) + system cpu time (1:31.09) + XX-- > What is this XX extra time difference ? memory reading ? time taken for ? overhead ?
How can I reduce this part?. At the end, this XX is what makes my code go in general about 70% slower.
Thank you for your time and consideration,
@carles wrote:
I have already checked some answers related to this. Nevertheless, I have not found a more specific answer to this question:
Let's assume I have this log from some query or data step I have done:
I always thought that real time (5:06.17) would be = user cpu time (42.77 seconds ) + system cpu time (1:31.09) + XX-- > What is this XX extra time difference ? memory reading ? time taken for ? overhead ?
Yes.
Disk access (read and write), swapping out of memory and back if the entire data set/proc use can't be held in memory, network traffic, network bottlenecks to remote storage, complexity of the operations, dataset size in related to what you do (Proc print tends to take less time than a complex regression), formatting complex/large output tables. Lots of things depends on the job.
Generally the more data pushed around that isn't needed (unneeded variables or records) adds time to disk writes and reads but other elements have different solutions. Is your procedure generating lots of output that you don't need? Select the desired output (ODS SELECT). If external data bases are involved determine whether in data base actions may be faster than pulling to SAS for joins and such.
Specific code or general examples of what you do might get better targeted responses.
@carles wrote:
I have already checked some answers related to this. Nevertheless, I have not found a more specific answer to this question:
Let's assume I have this log from some query or data step I have done:
I always thought that real time (5:06.17) would be = user cpu time (42.77 seconds ) + system cpu time (1:31.09) + XX-- > What is this XX extra time difference ? memory reading ? time taken for ? overhead ?
Yes.
Disk access (read and write), swapping out of memory and back if the entire data set/proc use can't be held in memory, network traffic, network bottlenecks to remote storage, complexity of the operations, dataset size in related to what you do (Proc print tends to take less time than a complex regression), formatting complex/large output tables. Lots of things depends on the job.
Generally the more data pushed around that isn't needed (unneeded variables or records) adds time to disk writes and reads but other elements have different solutions. Is your procedure generating lots of output that you don't need? Select the desired output (ODS SELECT). If external data bases are involved determine whether in data base actions may be faster than pulling to SAS for joins and such.
Specific code or general examples of what you do might get better targeted responses.
Note that if your process uses multiple CPUs the CPU time can be greater than wall clock time.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Save $200 when you sign up by March 14!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.