From hpages at fhcrc.org  Thu Apr 17 21:04:50 2008
From: hpages at fhcrc.org (Herve Pages)
Date: Thu, 17 Apr 2008 12:04:50 -0700
Subject: [Rd] Couldn't (and shouldn't) is.unsorted() be faster?
Message-ID: <48079F52.5090708@fhcrc.org>

Hi,

Couldn't is.unsorted() bail out immediately here (after comparing
the first 2 elements):

 > x <- 20000000:1
 > system.time(is.unsorted(x), gcFirst=TRUE)
    user  system elapsed
   0.084   0.040   0.124

 > x <- 200000000:1
 > system.time(is.unsorted(x), gcFirst=TRUE)
    user  system elapsed
   0.772   0.440   1.214

Thanks!
H.



[Rd] Couldn't (and shouldn't) is.unsorted() be faster?
Herve Pages