GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — (Improvements) Ring-buffer and XdrReaderWriter optimizations, assorted Span/Memory method additions by pl752 · Pull Request #1253 · FirebirdSQL/NETProvider

Conversation

@pl752

@pl752 pl752 commented Dec 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Decided to split up my previous pull request (#1247) to multiple PRs due to it having set of changes too broad in my opinion. Ran tests as usual for fb3 server and embedded. Updated to current master branch state. Also decided to throw in reworked ring-buffer Queue's to be more large object friendly.

TLDR: Ellimination of most of the repeated allocations for intermediate conversions, also added inplace copy methods for I/O and reworked intermediate network buffers to use proper ring-buffer resizable arrays with unitary copying instead of per-byte queueing, massively boosting large objects throughput.

Practical benchmarks (3 int and 1 char100 columns, real I/O with fb3 server on localhost and nvme)

Master:

Method Rows Mean Error StdDev Median Gen0 Gen1 Allocated
SelectAndMap_Main_ReusedBufferAsync 10 1.796 ms 0.0649 ms 0.1904 ms 1.784 ms - - 457.27 KB
SelectAndMap_Main_ReusedBufferAsync 100 8.326 ms 0.5724 ms 1.5955 ms 7.472 ms - - 4502.13 KB
SelectAndMap_Main_ReusedBufferAsync 1000 31.037 ms 3.7512 ms 10.8231 ms 24.973 ms 5000.0000 1000.0000 44985.72 KB
SelectAndMap_Main_ReusedBufferAsync 10000 337.278 ms 16.5461 ms 48.7865 ms 334.254 ms 55000.0000 10000.0000 449543.01 KB
SelectAndMap_Main_ReusedBufferAsync 100000 3,467.848 ms 98.9785 ms 288.7249 ms 3,435.619 ms 550000.0000 114000.0000 4494685.62 KB

New (isolated from Rune opt (#1252)):

Method Rows Mean Error StdDev Median Gen0 Gen1 Allocated
SelectAndMap_Main_ReusedBufferAsync 10 1.614 ms 0.0500 ms 0.1450 ms 1.584 ms - - 447 KB
SelectAndMap_Main_ReusedBufferAsync 100 9.760 ms 0.1127 ms 0.0880 ms 9.746 ms - - 4411.49 KB
SelectAndMap_Main_ReusedBufferAsync 1000 22.283 ms 2.1941 ms 6.1524 ms 19.432 ms 5000.0000 1000.0000 43999.39 KB
SelectAndMap_Main_ReusedBufferAsync 10000 221.000 ms 9.0103 ms 26.1406 ms 221.383 ms 53000.0000 10000.0000 439534.85 KB
SelectAndMap_Main_ReusedBufferAsync 100000 2,317.527 ms 46.2359 ms 108.0750 ms 2,342.930 ms 538000.0000 108000.0000 4394711.29 KB

Combined with #1252:

Method Rows Mean Error StdDev Median Gen0 Gen1 Allocated
SelectAndMap_Main_ReusedBufferAsync 10 471.8 us 15.22 us 43.68 us 462.0 us - - 43.98 KB
SelectAndMap_Main_ReusedBufferAsync 100 1,638.7 us 62.67 us 182.81 us 1,590.5 us - - 383.96 KB
SelectAndMap_Main_ReusedBufferAsync 1000 13,283.3 us 2,299.73 us 6,561.26 us 9,672.6 us - - 3785.55 KB
SelectAndMap_Main_ReusedBufferAsync 10000 92,663.6 us 2,673.87 us 7,841.99 us 91,372.1 us 4000.0000 - 37583.41 KB
SelectAndMap_Main_ReusedBufferAsync 100000 897,179.0 us 17,724.27 us 24,846.95 us 900,061.5 us 45000.0000 5000.0000 375392.09 KB

Perf (defaults):

Method Job BuildConfiguration DataType Count Mean Error StdDev Ratio RatioSD Gen0 Allocated Alloc Ratio
Execute NuGet ReleaseNuGet bigint 100 19,426.6 us 195.03 us 172.89 us 1.00 0.01 31.2500 290.31 KB 1.00
Execute Project Release bigint 100 19,731.2 us 376.18 us 369.46 us 1.02 0.02 - 192.32 KB 0.66
Fetch NuGet ReleaseNuGet bigint 100 461.9 us 5.48 us 5.12 us 1.00 0.02 5.8594 52.02 KB 1.00
Fetch Project Release bigint 100 449.6 us 3.00 us 2.81 us 0.97 0.01 3.9063 39.03 KB 0.75
Execute NuGet ReleaseNuGet varch(...) utf8 [30] 100 19,592.1 us 172.88 us 144.36 us 1.00 0.01 31.2500 294.24 KB 1.00
Execute Project Release varch(...) utf8 [30] 100 19,419.8 us 96.03 us 80.19 us 0.99 0.01 - 194.64 KB 0.66
Fetch NuGet ReleaseNuGet varch(...) utf8 [30] 100 466.2 us 2.37 us 2.22 us 1.00 0.01 6.8359 55.9 KB 1.00
Fetch Project Release varch(...) utf8 [30] 100 458.4 us 3.01 us 2.67 us 0.98 0.01 3.9063 39.77 KB 0.71

Boost for large object I/O is significant. Benchmarks were performed without compression and encryption (typical for walled LAN / server sharing db with apps in single env). For small data types and writing operations, changes in practice are much smaller, but some difference in allocations can be observed still. Such an effect on performance is mostly due to ellimination of copies and ability for system to use packed operations (r/w with 64 bit ops instead of 8x8 bit ops) or even simd when dealing with the buffers, and also jit should be much happier with the new installment. For large blobs with the same mode boost can be even bigger with the bypass mode (less copies).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pl752 pl752 mentioned this pull request Dec 29, 2025
(Improvements) Rune related and span-ish optimizations #1247
Closed
pl752 added 3 commits May 21, 2026 12:12
@pl752
Optimized intermediate buffers with stackalloc, spans and array pools
8231adb
@pl752
Implemented proper ring-buffers instead of Queues and bypass for no-e…
75226fa
…ncrypt and no-compress
@pl752
Implemented array return through disposal for ring-buffer
959386a
@pl752
pl752 force-pushed the span_opt_1 branch from 0e74c9c to 959386a Compare May 21, 2026 07:12
pl752 added 2 commits November 10, 2026 12:49
@pl752
Fix async Boolean writes using pooled buffer capacity
7c77170
@pl752
Serialize network writes and flushes during cancellation
6e1b81a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@pl752
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.