ODS图形打开选项产生更好的图形,但似乎比基础图形多花800倍的时间。我用各种不同的程序体验过这一点。平台是windows 7上的SAS 9.4。
Q1:这是典型的/预期的吗?我可以发誓,去年在同事的机器上生成ODS图表的速度要快得多。
Q2:我如何才能加快速度,现在我可以手动创建图表,比ODS图形更快。此外,基础图表看起来不够专业,也许有一种方法可以将它们自动导出为具有抗锯齿字体的像样的png或svg格式?(请记住,我想编写一个自动创建数千个图表的程序)。
Q3:我应该放弃ODS图形,转而使用传统图形吗?
下面是一个例子。如果您执行这段代码并查看日志中的执行时间,我看到关闭ODS图形的shewhart过程的执行时间是0.09秒,而打开ODS图形的时间是1:13.11秒甚至1:20.23秒。如果我另外请求html输出,每个图表可能需要2分钟以上的时间。
/**********************************************************
Example illustrating ODS vs base graphics runtimes.
ODS takes orders of magnitude longer.
***********************************************************/
data jets;
input Engine Diam @@;
label Engine = "Engine Number";
datalines;
1 78.4 2 80.1 3 84.4 4 79.1 5 80.4
6 83.5 7 73.8 8 83.5 9 75.0 10 76.8
11 70.5 12 80.3 13 82.4 14 79.4 15 86.4
16 90.5 17 77.7 18 82.5 19 79.9 20 83.2
;
/**********************************************************
ODS Graphics off
***********************************************************/
ods graphics off;
title 'Individual Measurements and Moving Range Charts';
title2 'Jet Engine Diameters (cm)';
proc shewhart data=Jets;
irchart Diam*Engine;
run;
/**********************************************************
ODS Graphics on
***********************************************************/
ods graphics on;
title 'Individual Measurements and Moving Range Charts';
title2 'Jet Engine Diameters (cm)';
proc shewhart data=Jets;
irchart Diam*Engine;
run;
/**********************************************************
ODS Graphics on, ODS HTML
***********************************************************/
ods html file="irchart.html" path=gout style=STATISTICAL;
title 'Individual Measurements and Moving Range Charts';
title2 'Jet Engine Diameters (cm)';
proc shewhart data=Jets;
irchart Diam*Engine;
run;
ods html close;
ods graphics off;和日志:
551 /**********************************************************
552 Example illustrating ODS vs base graphics runtimes.
553 ODS takes orders of magnitude longer.
554 ***********************************************************/
555 data jets;
556 input Engine Diam @@;
557 label Engine = "Engine Number";
558 datalines;
NOTE: SAS went to a new line when INPUT statement reached past the end of a
line.
NOTE: The data set WORK.JETS has 20 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
563 ;
564
565 /**********************************************************
566 ODS Graphics off
567 ***********************************************************/
568 ods graphics off;
569 title 'Individual Measurements and Moving Range Charts';
570 title2 'Jet Engine Diameters (cm)';
571 proc shewhart data=Jets;
572 irchart Diam*Engine;
573 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used
to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: 48462 bytes written to C:\Users\carda10\sasgraph.svg.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 0.09 seconds
cpu time 0.07 seconds
574
575 /**********************************************************
576 ODS Graphics on
577 ***********************************************************/
578 ods graphics on;
579 title 'Individual Measurements and Moving Range Charts';
580 title2 'Jet Engine Diameters (cm)';
581 proc shewhart data=Jets;
582 irchart Diam*Engine;
583 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used
to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 1:09.06
cpu time 1.20 seconds
584
585 /**********************************************************
586 ODS Graphics on, ODS HTML
587 ***********************************************************/
588 ods html file="irchart.html" path=gout style=STATISTICAL;
NOTE: Writing HTML Body file: irchart.html
589 title 'Individual Measurements and Moving Range Charts';
590 title2 'Jet Engine Diameters (cm)';
591 proc shewhart data=Jets;
592 irchart Diam*Engine;
593 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used
to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 1:11.89
cpu time 1.31 seconds
594
595 ods html close;
596 ods graphics off;更新:我认为这与打印机(是物理的)访问有关。
发布于 2016-09-14 01:47:49
事实证明这与打印机访问有关。
我注意到,在其他桌面应用程序中,有时需要大约20秒才能访问远程默认打印机。
其次,我还注意到,当我在打印机可访问的网络上时,生成每个图表所需的时间要短得多。
然后,我将我的默认打印机切换到了一个人造adobe pdf生成器。这将图表生成时间从1-2分钟缩短到0.09秒。
该效果可通过切换回不可达的网络打印机来再现,并可通过从网络打印机切换而再次解决。
因此,PROC SHEWHART和其他操作似乎被延迟,并在每次要生成图表时等待联系网络打印机,即使图表不会发送到打印机。
发布于 2016-08-15 22:44:51
我无法复制您的结果,在Linux服务器上运行9.4。
有时ODS图形对我来说确实很慢,但它更像是每个图形慢半秒,而不是10秒或2分钟。我认为@Reeza关于尝试技术支持的建议是很好的。
我在你的更新中看到,你关闭了所有的ODS目的地有帮助。当然,如果你打开了多个目的地,可能需要不同的图像格式,这会减慢速度。但是,对于一个简单的图表来说,2分钟似乎仍然超出了范围。
我的日志是:
22 /**********************************************************
23 ODS Graphics off
24 ***********************************************************/
25 ods graphics off;
26 title 'Individual Measurements and Moving Range Charts';
27 title2 'Jet Engine Diameters (cm)';
28 proc shewhart data=Jets;
29 irchart Diam*Engine;
30 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: 33382 bytes written to /sas/saswork/.../shewhar5.png.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 0.16 seconds
cpu time 0.16 seconds
31
32 /**********************************************************
33 ODS Graphics on
34 ***********************************************************/
35 ods graphics on;
36 title 'Individual Measurements and Moving Range Charts';
37 title2 'Jet Engine Diameters (cm)';
38 proc shewhart data=Jets;
39 irchart Diam*Engine;
40 run;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: Three-sigma limits are assumed.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used to compute the control limits.
NOTE: For process variable Diam moving ranges are based on 2 consecutive values.
NOTE: There were 20 observations read from the data set WORK.JETS.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 0.23 seconds
cpu time 0.08 secondshttps://stackoverflow.com/questions/38944305
复制相似问题