Skip to content

Commit

Permalink
Add a comment about faster compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Aug 14, 2024
1 parent 60b7e71 commit a32111d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tools/jit/_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ async def _build_stencils(self) -> dict[str, _stencils.StencilGroup]:
tasks.append(group.create_task(coro, name="trampoline"))
template = TOOLS_JIT_TEMPLATE_C.read_text()
for case, opname in cases_and_opnames:
# Write out a copy of the template with *only* this case
# inserted. This is about twice as fast as #include'ing all
# of executor_cases.c.h each time we compile (since the C
# compiler wastes a bunch of time parsing the dead code for
# all of the other cases):
c = work / f"{opname}.c"
c.write_text(template.replace("CASE", case))
coro = self._compile(opname, c, work)
Expand Down

0 comments on commit a32111d

Please sign in to comment.