@emexes I know that this going too far, but it may be interesting to the OP and others.
I made the lines longer, about 220 characters each. Only two lines out of 154 contain Crimson.
Curiously, when I ran this again, the time was even shorter, 19 milliseconds. Probably because of runtime optimization of Java code.
Also, I am logging only the first iteration - only two lines are logged.
The main message I want to convey is that it is extremely easy and fast to check out ideas and scenarios in B4X with just a few lines of code.
Anyone who uses B4X already knows that.
Dim lines As List = File.ReadList(File.DirAssets, "colors.txt")
Log(lines.Size) 'Log: 154
For i = 0 To lines.size - 1
Dim line As String = lines.Get(i)
Dim sb As StringBuilder: sb.Initialize
For j = 0 To 9
sb.Append(line).Append(" ")
Next
lines.Set(i, sb.ToString)
Next
Log(lines.Get(0).As(String).Length) 'Log: 220
Dim marktime As Long = DateTime.Now
For k = 1 To 1000
For i = 0 To lines.Size - 1
Dim s As String = lines.get(i)
If s.Contains("Crimson") Then
If k = 1 Then Log(i & TAB & s)
End If
Next
Next
Log(DateTime.Now - marktime) 'Searching 154000 lines took 19 milliseconds