On Tuesday, 26 January 2021 at 17:40:36 UTC, methonash wrote:
foreach( i, ref pStr; sortedArr )
{
foreach( j, ref cStr; sortedArr[ i + 1 .. $ ] )
{
if( indexOf( pStr, cStr ) > -1 )
{
// ...
}
}
}
Before adding the code excerpt above, the Dlang program was
taking ~1 second on an input file containing approx. 64,000
strings.
By adding the code above, the program now takes 6 minutes to
complete.
It would be much easier for us to help you with this if you could
post the full program, or at the very least a reduced version
that reproduces the same issue. [1] Since your attempts so far
have failed to fix the problem, it is quite likely that some part
of the code you do not suspect is actually to blame.
[1] https://idownvotedbecau.se/nomcve/