Commit 58ebd70
authored
Add temporary clock-sync probe to separate pre-work time from real work (#1670)
workerd freezes Date.now() until I/O completes, so any delta taken across
a request's first I/O silently includes queueing, isolate start and module
evaluation. That artifact made every phase before the first await read 0ms
and whichever await came first read multi-second, regardless of what it
actually did.
Await scheduler.wait(0) at handler entry to force the clock forward, and
log the delta it absorbs. That delta is the pre-work time; everything
measured after it is honest. Temporary, to be reverted.1 parent c0d25e4 commit 58ebd70
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
182 | 208 | | |
183 | 209 | | |
184 | 210 | | |
| |||
0 commit comments