Problem

Consider the following Python function,

import numpy as np
def count(xvec):
    """
    Return the count of elements of the input `xvec` whose natural logarithm is less than `0`.
    """
    counter = 0
    for element in xvec: 
        if np.log(element) < 0: counter += 1
    return counter

What can you do to the above code to make it more performant?
Prove your suggestion by benchmarking your revised code against the original code above.
How much performance improvement do you observe?

Comments