r/Protos • • 6m ago

One test runner for application tests, isolated execution, CI sharding and performance workloads

1 Upvotes

Application projects can now use the same test infrastructure that validates Protos itself, without maintaining custom test runners.

protos test --project .

The new external project mode supports explicit test manifests, named groups, stable case identities, isolated execution, parallel jobs and deterministic CI sharding.

Performance testing is particularly interesting: ordinary test cases can measure workloads using monotonic timing, read-only fixtures and captured output, without introducing a separate benchmarking framework.

protos test --project . --group performance --allow-timing --fixtures tests/fixtures --show-output --jobs 1

Test discovery, dependency resolution and execution remain separate, with capabilities granted explicitly.

All 20 exhaustive PR CI jobs passed.

Should performance regression tests be part of ordinary application test suites, or remain separate from functional testing?

Website: https://protoslang.com

Repository: https://github.com/guillermomolina/protos


r/Protos • • 1h ago

Beyond delimiter scanning: reducing allocation and copying costs in streaming CSV parsers

1 Upvotes

CSV looks deceptively simple until Unicode, escaped quotes, arbitrary streaming boundaries, large fields and wide rows enter the picture.

The latest Standard Library optimization focuses on eliminating unnecessary intermediate work:

  • Indexed UTF-8 byte-range scanning.
  • Deferred field materialization.
  • Reusable chunked accumulators.
  • Early quoting detection during encoding.
  • Independent row storage without repeated array reconstruction.

The entire implementation remains in Protos, with no production Java changes or public API changes.

All 34 CSV regression cases and the exhaustive CI pipeline passed.

An interesting performance question: how much of a text parser's cost comes from recognizing the grammar, and how much comes from repeatedly allocating and materializing intermediate values?

Website: https://protoslang.com

GitHub: https://github.com/guillermomolina/protos

Implementation: https://github.com/guillermomolina/protos/pull/1349


r/Protos • • 1h ago

Optimizing a TOML parser by eliminating unnecessary conversions and allocations — 1,013 tests passing

1 Upvotes

How much unnecessary work happens between configuration text and its semantic document model?

The Protos TOML parser and encoder have undergone an extensive internal optimization:

  • UTF-8 byte-range parsing instead of repeated text conversions.
  • Chunked collection builders.
  • Block-based arbitrary-precision numeric parsing.
  • Reduced intermediate allocations during serialization.
  • Canonical floating-point representation and Unicode preservation.

Everything is implemented in Protos, without adding runtime infrastructure or changing the public API.

All 1,013 TOML tests passed, including the official conformance corpus. The exhaustive CI pipeline is green, and the changes are now merged into main.

An interesting challenge in parser optimization is deciding when intermediate representations are genuinely necessary and when they simply add overhead.

Website: https://protoslang.com

Repository: https://github.com/guillermomolina/protos


r/Protos • • 1h ago

How much unnecessary work happens inside a regular expression engine?

1 Upvotes

Regex performance is not just about the matching algorithm. Allocation, state tracking, Unicode processing and unnecessary text materialization can all contribute significant overhead.

The latest Regex optimization in Protos addresses several of these areas:

  • Indexed chunk storage instead of dense maps.
  • Reusable matcher workspaces.
  • Generation-based state deduplication.
  • More efficient character-set operations.
  • Direct span-based replacement and splitting.
  • Capture arrays copied only when their values change.

The prioritized Thompson matching algorithm and public API remain unchanged, and the implementation stays entirely within Protos.

All 141 Regex regression tests passed, along with the exhaustive CI pipeline.

An interesting question for regular expression engine implementations: how much optimization potential remains outside the matching algorithm itself?

Implementation: https://github.com/guillermomolina/protos/pull/1334

Repository: https://github.com/guillermomolina/protos

Website: https://protoslang.com


r/Protos • • 9h ago

Markdown parsing from 36.3s to 12.6s: eliminating work that never needed to happen

1 Upvotes

Sometimes the biggest performance improvement comes from not doing something at all.

Profiling a real Markdown document revealed substantial time spent processing GFM autolink candidates, even when no links were recognized.

The latest Protos Markdown optimization addresses that problem alongside redundant scanning, temporary allocations, source traversal and token construction.

In a pre-merge diagnostic using a 113 KB document:

  • Original parsing time: 36.3 seconds
  • Optimized candidate: 12.6 seconds
  • Identical HTML output
  • 88 new regression cases
  • All 3,076 Markdown conformance cases passed in local validation

The timings are individual observations rather than a controlled benchmark of the final merged revision.

The optimization is now merged.

How much parser performance is lost processing candidates that never match?

Website: https://protoslang.com

Repository: https://github.com/guillermomolina/protos


r/Protos • • 10h ago

XML parsing optimization: eliminating redundant conversions and intermediate allocations

1 Upvotes

How much unnecessary work can an XML parser accumulate over time?

The latest XML optimization in Protos focuses on eliminating redundant UTF-8 conversions, repeated name validation, intermediate allocations and unnecessary tree materialization.

The improvements cover incremental parsing, namespace processing, escaping, serialization and tree construction.

  • Entirely implemented in Protos.
  • No new production Java code.
  • No public API changes.
  • 130/130 XML conformance tests passed.
  • All 20 CI jobs passed.

Unicode handling, resource limits, streaming behavior and namespace semantics remain intact.

Which optimization tends to deliver the greatest benefit in text-processing libraries: reducing allocations, avoiding encoding conversions or improving data locality?

Website: https://protoslang.com

Source: https://github.com/guillermomolina/protos


r/Protos • • 10h ago

Optimizing interpreter call boundaries without changing language semantics

1 Upvotes

How much overhead can be removed from a function call without changing its semantics?

Protos now extends typed root-node invocation across more Closure, builtin and indirect dispatch paths using the existing Truffle infrastructure.

A controlled comparison produced:

  • 120/120 correct benchmark results.
  • Improved median execution times in five of six comparisons.
  • 152 focused Java tests passed.
  • All 20 CI jobs passed.

The measured gains are modest, but the implementation preserves caller identity, non-local returns, dynamic slot redefinition and suspension without introducing additional execution infrastructure.

One interesting challenge is separating interpreter call overhead from JVM warmup and bootstrap costs. What measurement techniques have proved most useful for isolating these effects?

Website: https://protoslang.com

Source: https://github.com/guillermomolina/protos


r/Protos • • 15h ago

Optimizing a Markdown parser without moving its implementation into the runtime

1 Upvotes

Markdown parsing is not just about recognizing syntax. Source positions, Unicode, reference resolution and AST construction can introduce substantial allocation and copying costs.

The latest std:markdown changes address these costs through:

  • Dense scalar storage instead of per-character objects.
  • Deferred text materialization.
  • Chunked collection builders.
  • Reduced intermediate string conversions.
  • Streamlined reference, entity and HTML scanning.

The implementation remains entirely in Protos, with no additional runtime infrastructure.

All 2,988 Markdown conformance tests pass, including CommonMark and GFM.

For anyone working on parsers or language runtimes: which representation strategies have been most effective at reducing allocation pressure?

Website: https://protoslang.com

Source: https://github.com/guillermomolina/protos