Commit 52769cd
Add describe() benchmark and suite-hygiene tweaks
Adds script/benchmark_describe.rb comparing OracleEnhanced::Connection#describe
across three implementations on a 1000-object schema (700 tables + 100 views
+ 100 private synonyms + 100 public synonyms):
- master: UNION ALL over all_tables / all_views / all_synonyms
- PR rsim#2521: single all_objects query
- this POC: DBMS_UTILITY.NAME_RESOLVE
Benchmark environment:
- CPU: AMD Ryzen 9 7940HS (16 threads)
- RAM: 60 GiB
- OS: Ubuntu (kernel 7.0, x86_64)
- Database: Oracle Database 23.26.1 Free, docker image oracle/database:23.26.1-free
on localhost (no network hop)
- Ruby: CRuby 4.0.2 (ruby-oci8 HEAD) / JRuby 10.0.5.0 (ojdbc17.jar)
The absolute numbers below are not meaningful on their own — they reflect
this one machine, one container, and one Oracle release. Only the
relative differences between the three implementations matter.
Shared fixtures across all six runs so every implementation hits the
same shared-pool / dictionary cache state.
Avg ms per describe() call (lower is better):
case master PR rsim#2521 POC master PR rsim#2521 POC
CRuby CRuby CRuby JRuby JRuby JRuby
tables 0.744 0.311 0.104 1.501 0.723 0.308
views 0.647 0.251 0.107 0.957 0.507 0.254
private synonyms 1.440 1.157 0.234 2.184 1.908 0.235
public synonyms 1.275 0.990 0.258 1.862 1.585 0.230
all mixed 0.842 0.432 0.111 1.054 0.633 0.186
The "all mixed" row is the most representative of real Rails workloads:
the POC is ~7.6x faster than master and ~3.9x faster than PR rsim#2521 on
CRuby, and ~5.7x / ~3.4x on JRuby. The synonym win is the largest —
NAME_RESOLVE follows the synonym server-side in one round trip, whereas
PR rsim#2521 still issues a second all_synonyms query.
Also adds a before(:suite) hook that runs PURGE RECYCLEBIN. Dropped
tables from earlier spec runs accumulate in USER_RECYCLEBIN and can
mask issues (ORA-00955 on re-create, stale BIN\$... entries in
all_objects). The hook makes every rspec invocation start clean.
Fixture counts stay tunable via TABLE_COUNT / VIEW_COUNT / SYNONYM_COUNT.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3b17f1a commit 52769cd
2 files changed
Lines changed: 138 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
0 commit comments