Commit 5f05749
chore: Lazy import DatabaseSessionService in the adk/sessions/ module
This accounts for about 8% of latency in cold start, because DatabaseSessionService imports from sqlalchemy. After the change, DatabaseSessionService is only imported if it's really needed by the program. The other objects in this file are not affected because they contribute to a small fraction of the latency.
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 8290098681 parent 8dd5a79 commit 5f05749
1 file changed
+13
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 20 | | |
26 | 21 | | |
| 22 | + | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
33 | | - | |
34 | | - | |
35 | 29 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments