[Rd] Argument error reporting slowness

McGehee, Robert Robert.McGehee at geodecapital.com
Wed Nov 1 02:15:05 CET 2006


Hello,
My work with large datasets slows down a fair amount in R 2.4.0 when I
mistakenly pass in a large dataset using an incorrect argument. That is,
the same error message for reporting an incorrect argument usage when I
pass in a 1e8 length matrix takes 3 minutes on R 2.4.0 versus 0.01
seconds on R 2.3.1 This slowness may be an unintentional side effect of
a creating a better error message for reporting bad arguments. For even
larger data sets, I have chosen to kill my R session rather than wait
out this error if mis-typing an argument name.

For instance,
## In R 2.3.1, immediate reporting
> system.time(cor(badArg = matrix(1:1e8)))
Error in cor(badArg = matrix(1:1e+07)) : unused argument(s) (badArg ...)
Timing stopped at: 0 0.01 0.02 NA NA

## In R 2.4.0, extremely slow
> system.time(cor(badArg = matrix(1:1e8)))
Error in cor(badArg = matrix(1:1e+08)) : unused argument(s) (badArg =
c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 
Timing stopped at: 175.84 1.546 177.423 0 0

Best,
Robert

platform       x86_64-unknown-linux-gnu                   
arch           x86_64                                     
os             linux-gnu                                  
system         x86_64, linux-gnu                          
status         Patched                                    
major          2                                          
minor          4.0                                        
year           2006                                       
month          10                                         
day            03                                         
svn rev        39576                                      
language       R                                          
version.string R version 2.4.0 Patched (2006-10-03 r39576)

Robert McGehee
Quantitative Analyst
Geode Capital Management, LLC
1 Post Office Square, 28th Floor | Boston, MA | 02109
Tel: 617/392-8396    Fax:617/476-6389
mailto:robert.mcgehee at geodecapital.com



This e-mail, and any attachments hereto, are intended for us...{{dropped}}




More information about the R-devel mailing list