Re: [GIT PULL] kdbus for 4.1-rc1

From: Steven Rostedt
Date: Fri Apr 24 2015 - 10:02:19 EST


On Thu, Apr 23, 2015 at 11:33:19PM +0200, Richard Weinberger wrote:
> > No it's not. O(256) equals O(1).
>
> Yeah, that's absolutely correct.
> I think Boris wanted to say that iterating over all hash buckets
> can be costly.

You are thinking of 'k' (the constant), where you usually have k*O(1), where k
does matter when comparing two algorithms with the same Big O value. And
sometimes even different O() values if the 'n' is small enough. 100*O(1) vs
1*O(n), the latter is better if n < 100.

Something that runs at O(n) but takes 1ms per n is a much worse algorithm than
something that runs at O(n) and takes 1us per n.

Both have the same O() notation, but which algorithm you use is obvious.

But Greg is right, you O notation isn't applicable here.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/