All these functions benefit from a sortcache, ordercache or sortordercache.
na.count, nvalid and nunique also benefit from a hashcache.
is.sorted checks for sortedness of x (NAs sorted first) na.count returns the number of NAs nvalid returns the number of valid data points, usually length minus na.count. nunique returns the number of unique values nties returns the number of tied values.
See Also
cache for caching functions and sortordercache for functions creating big caches