Remove scheduled optimization from ThreadedRegexVM

This does not seem to actually speed up execution as threads will
be dropped on next step anyway
This commit is contained in:
Maxime Coste 2023-02-13 21:15:55 +11:00
parent 3150e9b3cd
commit 762064dc68
2 changed files with 2 additions and 10 deletions

View File

@ -873,7 +873,7 @@ private:
const auto res = m_program.instructions.size();
if (res >= max_instructions)
throw regex_error(format("regex compiled to more than {} instructions", max_instructions));
m_program.instructions.push_back({ op, false, 0, param });
m_program.instructions.push_back({ op, 0, param });
return OpIndex(res);
}

View File

@ -112,9 +112,7 @@ struct CompiledRegex : RefCountable, UseMemoryDomain<MemoryDomain::Regex>
struct Instruction
{
Op op;
// Those mutables are used during execution
mutable bool scheduled;
mutable uint16_t last_step;
mutable uint16_t last_step; // mutable as used during execution
Param param;
};
static_assert(sizeof(Instruction) == 8);
@ -349,9 +347,6 @@ private:
release_saves(thread.saves);
};
auto consumed = [this, &thread]() {
if (m_program.instructions[thread.inst].scheduled)
return release_saves(thread.saves);
m_program.instructions[thread.inst].scheduled = true;
m_threads.push_next(thread);
};
@ -479,9 +474,6 @@ private:
while (not m_threads.current_is_empty())
step_thread(pos, current_step, m_threads.pop_current(), config);
for (auto& thread : m_threads.next_threads())
m_program.instructions[thread.inst].scheduled = false;
if (pos == config.end or
(m_threads.next_is_empty() and (not search or m_found_match)) or
(m_found_match and any_match))