Skip to content

Commit

Permalink
Remove calls to Thread.Sleep(0) (#153)
Browse files Browse the repository at this point in the history
These don't seem to help and can slow things down
  • Loading branch information
Tisit authored Mar 14, 2024
1 parent a56991d commit 29024df
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/SQLQueryStress/LoadEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ public void StartLoadThread(Object token)
if (_statsComm != null)
{
_statsComm.ExecuteNonQuery();
Thread.Sleep(0);
conn.InfoMessage += handler;
}
}
Expand All @@ -407,25 +406,20 @@ public void StartLoadThread(Object token)
if (_forceDataRetrieval)
{
var reader = _queryComm.ExecuteReader();
Thread.Sleep(0);

do
{
Thread.Sleep(0);

while (!runCancelled && reader.Read())
{
//grab the first column to force the row down the pipe
// ReSharper disable once UnusedVariable
var x = reader[0];
Thread.Sleep(0);
}
} while (!runCancelled && reader.NextResult());
}
else
{
_queryComm.ExecuteNonQuery();
Thread.Sleep(0);
}

_sw.Stop();
Expand Down

0 comments on commit 29024df

Please sign in to comment.