BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
carles
Fluorite | Level 6

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,

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@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.

View solution in original post

2 REPLIES 2
ballardw
Super User

@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.

Tom
Super User Tom
Super User

Note that if your process uses multiple CPUs the CPU time can be greater than wall clock time.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 373 views
  • 0 likes
  • 3 in conversation