Commit ddb551b
Speed up threaded-cursor spec by ~1.8s
The "should safely close cursors in threaded environment" example in
spec/plsql/schema_spec.rb spawns two threads that call
DBMS_SESSION.sleep (or DBMS_LOCK.sleep on pre-18c) and joins them.
The point of the test is that two concurrent calls on the same
connection don't trip the cursor pool — the sleep durations are only
there to keep both calls in flight at once.
The original 1- and 2-second sleeps dominated the suite at ~2.05s
out of ~10s total (~21%, the slowest example by a wide margin).
Drop them to 0.1s and 0.2s, which still gives 100ms of
guaranteed-overlap and a 100ms ordering gap between the two threads
— far more than OS scheduling needs to keep both in flight. Verified
stable across three back-to-back runs at ~0.29s each.
Net effect: full suite drops from ~9.93s to ~8.08s (~19% faster);
this example moves from #1 to rsim#4 in the slowest-examples profile.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 416e451 commit ddb551b
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
| 258 | + | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
0 commit comments