Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on John Carmack on Inlined Code. Parent comment
(1) 40ms for inline code;
(2) 150ms for an inner function with one expression;
(3) 200ms for a slightly more complex inner function; and
(4) 4000ms+ for an inner function and an inner class.
def f1(n: int) -> int: return n * 2 def f2(n: int) -> int: def g(): return n * 2 return g() def f3(n: int) -> int: def g(): for _ in range(0): try: pass except Exception as exc: if isinstance(exc, 1): pass else: while True: pass raise Exception() return n * 2 return g() def f4(n: int) -> int: class X: def __init__(self, a, b, c): pass def _(self) -> float: return 1.23 def g(): for _ in range(0): try: pass except Exception as exc: if isinstance(exc, 1): pass else: while True: pass raise Exception() return n * 2 return g()
There are no comments on this comment yet.
(1) 40ms for inline code;
(2) 150ms for an inner function with one expression;
(3) 200ms for a slightly more complex inner function; and
(4) 4000ms+ for an inner function and an inner class.