fastest way to find which rows are NA in a given set of columns

DT <- copy(rbind(DT, DT, DT, DT))

which(rowSums(DT[, is.na(.SD), .SDcols=byCols])>0)

unique(which(DT[, is.na(.SD), .SDcols=byCols], arr.ind=TRUE)[, "row"])

unique(which(is.na(DT[, byCols, with=FALSE]), arr.ind=TRUE)[, "row"])

A  <- quote(replicate(N, which(rowSums(DT[, is.na(.SD), .SDcols=byCols])>0), simplify=FALSE))
B  <- quote(replicate(N, which(DT[, is.na(.SD), .SDcols=byCols], arr.ind=TRUE)[, "row"], simplify=FALSE))
C  <- quote(replicate(N, which(is.na(DT[, byCols, with=FALSE]), arr.ind=TRUE)[, "row"], simplify=FALSE))
D  <- quote(replicate(N, which(rowSums(is.na(DT[, byCols, with=FALSE])) > 0), simplify=FALSE))

N <- 1
stopifnot(identical(  sunique(eval(B)[[1]]), sunique(eval(A)[[1]])  ))
stopifnot(identical(  sunique(eval(B)[[1]]), sunique(eval(C)[[1]])  ))
stopifnot(identical(  sunique(eval(B)[[1]]), sunique(eval(D)[[1]])  ))

N <- 500
mbench(A, B, C, D, checkEQUAL=FALSE)


 
                     Times for a singe run are:        
                            A     B     C     D        
                        0.479 0.528 0.266 0.321        
                                                       
                   Microbenchmark will run 12 times    

 
 
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
                                     RESULTS:                                
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
                                                                             
                                                                             
       Measuring 'elapsed' time.                                             
       Units: seconds                             Number of Repetitions: 12  
                                                                             
        Expr      relative      Median Time       MAD      (2xMAD)/Median    
      ---------|-------------|----------------|---------|------------------- 
          C           1             0.29         0.01           6.9 %        
          D         1.14            0.33         0.01           6.1 %        
          B         1.59            0.46         0.02           8.7 %        
          A         1.79            0.52         0.01           3.8 %      