260 likes | 385 Views
Many to many, too many performance tests. Christoph Baumer, Biometrical Practice BIOP, Basel, Switzerland. PhUSE 2011 CS03. Many to many, too many performance tests.
E N D
Many to many, too many performance tests Christoph Baumer, Biometrical Practice BIOP, Basel, Switzerland PhUSE 2011 CS03
Many to many, too many performance tests In software engineering, performance testing is testing that is performed, to determine how fast some aspect of a system performs under a particular workload. It can also serve to validate and verify other quality attributes of the system, such as scalability, reliability and resource usage. Wikipedia Many to many, too many performance tests
Many to many, too many performance tests In software engineering, performance testing is testing that is performed, to determine how fast some aspect of a system performs under a particular workload. It can also serve to validate and verify other quality attributes of the system, such as scalability, reliability and resource usage. Wikipedia Many to many, too many performance tests 1/10/2010 3
Many to many, too many performance tests What is needed for performance testing in a clinical environment? Transparent approach Modular and flexible setting of testing environments Simulation of real world scenarios Many to many, too many performance tests 1/10/2010 4
Many to many, too many performance tests Available options 1. Running a single program in a batch job. 2. Running a program multiple times. 3. Running programs in different orders Many to many, too many performance tests 1/10/2010 5
Many to many, too many performance tests Many to many Example – merging WHO ATC text with drugname Many to many, too many performance tests 1/10/2010 6
Many to many, too many performance tests Many to many Programs Program 1 & 2: SQL join Program 3 & 4: Point option Program 5: Formats Program 6: Sorting and merging Many to many, too many performance tests 1/10/2010 7
Many to many, too many performance tests Program 1: %let description=sql inner join; procsql; createtable atc1 as select atc.atctxt, mp.drugname from thg innerjoin atc on thg.atccode eq atc.atccode innerjoin mp on thg.medprod eq mp.medprod; quit; Many to many, too many performance tests 1/10/2010 8
Many to many, too many performance tests Program 2: %let description=sql join with where clause; procsql; createtable atc2 as select atc.atctxt, mp.drugname from thg, atc, mp where thg.atccode eq atc.atccode and thg.medprod eq mp.medprod; quit; Many to many, too many performance tests 1/10/2010 9
Many to many, too many performance tests Program 3: %let description=point loops with mp inside; data atc3; set thg; do k = 1to nobs_atc; set atc(rename = (atccode = _atccode_)) nobs=nobs_atc point=k; if atccode eq _atccode_ thendo; do l = 1to nobs_mp; set mp(rename = (medprod = _medprod_)) nobs=nobs_mp point=l; if medprod = _medprod_ then output; end; end; end; keep atctxt drugname; run; Many to many, too many performance tests 1/10/2010 10
Many to many, too many performance tests Program 4: %let description=point loops with atc inside; data at4; set thg; do k = 1to nobs_mp; set mp(rename = (medprod = _medprod_)) nobs=nobs_mp point=k; if medprod = _medprod_ thendo; do l = 1to nobs_mp; set atc(rename = (atccode = _atccode_)) nobs=nobs_atc point=l; if atccode eq _atccode_ then output; end; end; end; keep atctxt drugname; run; Many to many, too many performance tests 1/10/2010 11
Many to many, too many performance tests Program 5: %letdescription=Using formats; procsql; createtable fmt_mp as select medprod as start , drugname as label , 'mp'as fmtname , 'n'as type from mp; createtable fmt_atc as select atccode as start , atctxt as label , 'atc'as fmtname , 'c'as type from atc; quit; procformatcntlin=fmt_mp; run; procformatcntlin=fmt_atc; run; data atc5; set thg; acttxt = put(atccode,atc.); drugname = put(medprod,mp.); keep atctxt drugname; run; Many to many, too many performance tests 1/10/2010 12
Many to many, too many performance tests Program 6: %letdescription=sorting and merging; procsortdata=atc; by atccode; run; procsortdata=thg; by atccode; run; data atc0; merge atc thg; by atccode; keep atctxt medprod; run; procsortdata=mp; by medprod; run; procsortdata=atc0; by medprod; run; data atc0; merge atc0 mp; by medprod; keep atctxt drugname; run; Many to many, too many performance tests 1/10/2010 13
Many to many, too many performance tests Base1: libname who "D:\many_to_many\lib"; data mp; set who.mp; run; data thg; set who.thg; run; data atc; set who.atc; run; Base2: libname who "D:\many_to_many\lib"; data thg; set who.thg; where official eq 'N'; run; procsql; createtable mp as select * from who.mp where medprod in (select medprod from thg); createtable atc as select * from who.atc where atccode in (select atccode from thg); quit; Base3: libname who "D:\many_to_many\lib"; data thg; set who.thg; if _n_ le 2000; run; procsql; createtable mp as select * from who.mp where medprod in (select medprod from thg); createtable atc as select * from who.atc where atccode in (select atccode from thg); quit; Many to many, too many performance tests 1/10/2010 14
Many to many, too many performance tests %inc(BASE1) %inc(PROG1) PROG1 PROG2 PROG3 … BASE1 BASE2 … %inc(BASE1) %inc(PROG2) PROGx %inc(BASE1) %inc(PROG3) BASEx %inc(BASE2) %inc(PROG1) %inc(BASE2) %inc(PROG1) Main Folder is read and program names are stored Programs with all combinations are created %inc(BASE2) %inc(PROG3) Many to many, too many performance tests 1/10/2010 15
Many to many, too many performance tests %inc(BASE1) <store start time> %inc(PROG1.SAS) <calculate execution time> <store results in the dataset RESULTS> %inc(BASE1) %inc(PROG1) Running a single program in a batch job Many to many, too many performance tests 1/10/2010 16
Many to many, too many performance tests Running a program multiple times Running programs in different orders %inc(BASE1) <store start time> %inc(PROG1.SAS) <calculate execution time> <store results in the dataset RESULTS> <store start time> %inc(PROG1.SAS) <calculate execution time> <store results in the dataset RESULTS> %inc(BASE1) <store start time> %inc(PROG1.SAS) <calculate execution time> <store results in the dataset RESULTS> <store start time> %inc(PROG2.SAS) <calculate execution time> <store results in the dataset RESULTS> Many to many, too many performance tests 1/10/2010 17
Many to many, too many performance tests Results dataset Many to many, too many performance tests 1/10/2010 18
Many to many, too many performance tests Program options &repeats: Specifies the number of repeats of a single program within a single run. This will add a program multiple times to a certain file / batch job. &n_runs: Specifies how many times each batch job is executed. &multiple: Specifies, if two programs run within the same batch job. Many to many, too many performance tests 1/10/2010 19
Many to many, too many performance tests %perf(n_runs=10); Used files: prog1 – prog6, base3 Many to many, too many performance tests 1/10/2010 20
Many to many, too many performance tests %perf(n_runs=5,repeats=3); Used files: prog1,prog2, prog5, prog6, base2 Many to many, too many performance tests 1/10/2010 21
Many to many, too many performance tests %perf(n_runs=5,repeats=3); Used files: prog1,prog2, prog5, prog6, base1 Many to many, too many performance tests 1/10/2010 22
Many to many, too many performance tests %perf(n_runs=10,multiple=YES); Used files: prog1,prog2, prog5, prog6, base2 Many to many, too many performance tests 1/10/2010 23
Many to many, too many performance tests Why? Prepared for the final run Improve your programming Gain understanding of SAS Many to many, too many performance tests
Many to many, too many performance tests Questions? Biop Presentation Title