Commit fde96e8
authored
Remove redundant calls to inspect.getsource (#7588)
Triton calls `inspect.getsource/getsourcelines` a fair amount during
compilation. The second call in `JITFunction.__init__` is completely
redundant since `getsource` just calls `getsourcelines` under the hood,
and caching the source lines on `JITFunction` also lets you skip the
calls in `get_jit_fn_file_line`. `getsource` is quite expensive, so this
saves >5% of the overall compile time. (Sadly, I think this is the last
of the easy compile time wins.)1 parent 981b0bb commit fde96e8
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
635 | | - | |
| 635 | + | |
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
| 647 | + | |
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| |||
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
980 | | - | |
| 980 | + | |
981 | 981 | | |
982 | 982 | | |
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
986 | | - | |
| 986 | + | |
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
| |||
0 commit comments