feat: indie status page MVP -- FastAPI + SQLite
- 8 DB models (services, incidents, monitors, subscribers, etc.) - Full CRUD API for services, incidents, monitors - Public status page with live data - Incident detail page with timeline - API key authentication - Uptime monitoring scheduler - 13 tests passing - TECHNICAL_DESIGN.md with full spec
This commit is contained in:
commit
902133edd3
4655 changed files with 1342691 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
"""Find basic blocks that are likely to be executed frequently.
|
||||
|
||||
For example, this would not include blocks that have exception handlers.
|
||||
|
||||
We can use different optimization heuristics for common and rare code. For
|
||||
example, we can make IR fast to compile instead of fast to execute for rare
|
||||
code.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from mypyc.ir.ops import BasicBlock, Branch, Goto
|
||||
|
||||
|
||||
def frequently_executed_blocks(entry_point: BasicBlock) -> set[BasicBlock]:
|
||||
result: set[BasicBlock] = set()
|
||||
worklist = [entry_point]
|
||||
while worklist:
|
||||
block = worklist.pop()
|
||||
if block in result:
|
||||
continue
|
||||
result.add(block)
|
||||
t = block.terminator
|
||||
if isinstance(t, Goto):
|
||||
worklist.append(t.label)
|
||||
elif isinstance(t, Branch):
|
||||
if t.rare or t.traceback_entry is not None:
|
||||
worklist.append(t.false)
|
||||
else:
|
||||
worklist.append(t.true)
|
||||
worklist.append(t.false)
|
||||
return result
|
||||
Loading…
Add table
Add a link
Reference in a new issue