Skip to content

Commit 232b39d

Browse files
yahondaclaude
andcommitted
Speed up pre-10.2 dbms_output spec by ~0.33s
The "should log output when database version is less than 10.2" example in spec/plsql/schema_spec.rb stubs database_version to [9, 2, 0, 0] so dbms_output retrieval falls into the per-line DBMS_OUTPUT.GET_LINE loop in PLSQL::ProcedureCall#dbms_output_lines instead of the batched DBMS_OUTPUT.GET_LINES path used on 10.2+. With times = 2_000 each iteration is one parse-and-exec round-trip, which is what made this example the second-slowest in the suite at ~0.42s. The intent of the example is to verify the alternate per-line code path works at all — 100 iterations exercise it just as well as 2_000 (the buffer-size assertions live in the unmocked examples right above). Drop times to 100. Verified stable across three back-to-back runs at ~0.09s each. After this and the threaded-cursor change, the slowest-examples profile is much more even (top spec is now ~0.33s). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ddb551b commit 232b39d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

spec/plsql/schema_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ class TestModel < TestBaseModel
352352

353353
it "should log output when database version is less than 10.2" do
354354
allow(plsql.connection).to receive(:database_version).and_return([9, 2, 0, 0])
355-
times = 2_000
355+
times = 100
356356
plsql.test_dbms_output_large("1234567890", times)
357357
expect(@buffer.string).to eq("DBMS_OUTPUT: 1234567890\n" * times)
358358
end

0 commit comments

Comments
 (0)