... If your list
list={1,1,1,1,0,0,0,1,1,1};
was a String :
mystring = (StringJoin @@ ToString /@ list)
(* 1111000111 *)
you could also do :
StringCases[mystring, s : (StartOfString ~~ (x_) ..) :> StringLength@s][[1]]
(* 4 *)
or
StringPosition[mystring, (StartOfString ~~ (x_) ..)][[1, -1]]
(* 4 *)
It is also fast because it just searchs the "start of the string".
Edit: Benchmarking
Needs["GeneralUtilities`"];
f1s[st_] := StringCases[st, s : (StartOfString ~~ (x_) ..) :> StringLength@s][[1]];
f2s[st_] := StringPosition[st, (StartOfString ~~ (x_) ..)][[1, -1]];
gs = (SeedRandom[0]; StringJoin @@ ToString /@ Clip@RandomInteger[100, #]) &;
then
BenchmarkPlot[{f1s, f2s}, gs, 2^Range[15], "IncludeFits" -> True, TimeConstraint -> 30]
gives a log(n) behaviour
whereas for longer lists ...
BenchmarkPlot[{f1s, f2s}, gs, 2^Range[20], "IncludeFits" -> True, TimeConstraint -> 30]
For relative time comparison here is what I get for the benchmarking of the other posts :
Update : for integers > 9
In the original post, I did not take into account (as remarked in the comment) that the list could contain integers >9 ... (however all the benchmarking and examples in the proposed answers do not treat this case).
Anyway, let's take the proposed list in the comment :
list = {1, 1, 111, 1111, 11111, 2, 3};
and transform it into a "useful" string
mystring = " " <> StringDrop[ToString@list, 1]
(* 1, 1, 111, 1111, 11111, 2, 3}*)
(*you could also test directly :*)
(*mystring="1,1,111,1111,11111,2,3"*)
then
StringCases[mystring, a : (StartOfString ~~ Shortest[(x__) ~~ ","] ..) :>
StringLength@a/(StringLength@x + 1)][[1]]
(*2*)
does the job and should be fast because it focuses on the start of the string.
Of course, the question was not about strings, but I thought it was interesting to extend and test ;)