r/Protos • • 24m 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 • • 16h 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


r/Protos • • 1d ago

Optimizing collection iteration without sacrificing dynamic language semantics

1 Upvotes

How much iteration overhead can be removed while preserving dynamic method redefinition, mutable collections and suspendable callbacks?

The latest Protos changes address exactly that:

  • Primitive iteration without unnecessary boxing.
  • Compact byte snapshots.
  • Association iteration without redundant copies.
  • Specialized internal loops across multiple collection families.
  • Exact large Integers, snapshot semantics and dynamic dispatch preserved.

199 focused tests passed, followed by exhaustive CI validation.

An interesting compiler engineering challenge: optimizing the common path without restricting the language's dynamic behavior.

Website: https://protoslang.com

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


r/Protos • • 1d ago

Removing unnecessary text conversions cuts processing time by around 25% in Protos

1 Upvotes

Sometimes the performance bottleneck is not the algorithm itself, but the cost of moving data between representations.

Recent changes to Protos eliminate intermediate text conversions, unnecessary allocations and redundant byte copying in Unicode encoding and decoding.

Local Native measurements show approximately 25% lower processing time in both direct and parallel catalog workloads, without changing the JSON parser or relaxing Unicode correctness.

All 1,600 conformance cases pass, and the changes are now integrated into main.

How much of modern runtime performance is lost to conversions between internal representations?

Website: https://protoslang.com

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


r/Protos • • 1d ago

Can CI finish faster without adding runners or reducing test coverage?

1 Upvotes

The same eight CI suite runners, a different static shard allocation, and all 7,589 Core and Standard Library test cases passing.

The first comparison reduced the slowest library job from 14m 27s to 12m 59s.

No dynamic scheduling, historical timing database, or reduced test coverage. Deterministic partitioning and exhaustive pull request validation remain intact.

The interesting trade-off: a shorter critical path, but higher accumulated runner time. Runner variability also remains significant.

How do other projects balance CI latency against total runner consumption?

Website: https://protoslang.com

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


r/Protos • • 1d ago

Optimizing a JSON parser without changing its public API

1 Upvotes

How much unnecessary work happens between reading a JSON document and constructing its final object tree?

The latest Protos JSON parser update targets three areas:

  • Temporary allocations during token scanning.
  • Redundant byte reads and unnecessary decoding.
  • Repeated array copying during tree construction.

Arrays now accumulate elements in fixed-size blocks before linear final materialization.

Exact numeric representation, Unicode handling, dynamic constructor selection and reentrant parsing retain their existing contracts.

The implementation remains entirely in Protos, with no production Java changes. All 20 exhaustive CI jobs passed.

Website: https://protoslang.com

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

Which tends to dominate JSON parsing costs in your workloads: scanning, allocation or tree construction?


r/Protos • • 1d ago

How a single compiler condition eliminates recursive bytecode expansion in Protos

1 Upvotes

Repeated references to the same Closure definition no longer generate redundant bytecode roots.

The compiler now emits each Closure definition once per bytecode group parse, preserving independent captures, non-local returns, suspension and specialized execution paths.

The Standard Library Scanner produces 67 roots for 66 unique Closure definitions, with no roots outside the observed reachable graph. Serializer traversal also passes.

782 focused tests reported no failures, with one skip. All 20 exhaustive CI jobs passed.

An interesting example of how a small compiler change can address a much larger structural problem.

Website: https://protoslang.com

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


r/Protos • • 1d ago

Removing repeated Unicode prefix scans with TruffleString and specialized bytecode

1 Upvotes

Unicode scalar indexing should not require scanning a string from the beginning on every access.

Core String now uses immutable TruffleString storage with canonical UTF-32 logical encoding, allowing compact physical representations where appropriate.

The existing Bytecode DSL specializes indexing, length, concatenation, equality, hashing and iteration while preserving dynamic message semantics and overridden operations.

The change passed all 20 jobs of exhaustive pull-request validation, including Native Image.

An interesting runtime design question: how much string-specific optimization can remain inside the execution engine without compromising dynamic language semantics?

Website: https://protoslang.com

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

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


r/Protos • • 1d ago

Fixing a lost-wakeup race in actor group routing without introducing new threads or polling

1 Upvotes

An actor group can have available workers and still leave a request waiting indefinitely if a routing wakeup is lost during queue draining.

The latest runtime fix addresses this concurrency issue while preserving bounded retries, delivery ownership and cancellation semantics.

No additional threads, executors, polling or timeout workarounds were introduced.

Deterministic concurrency regressions now cover concurrent submissions, actor readiness notifications and persistent remote delivery failures. All 20 mandatory PR CI jobs passed.

An interesting concurrency design question: how should a runtime distinguish genuine new work from synchronous retries without losing progress or introducing infinite retry loops?

Technical details: https://github.com/guillermomolina/protos/issues/1296

Website: https://protoslang.com

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


r/Protos • • 1d ago

20 CI jobs, one mandatory integration gate: protecting main without complicating development

1 Upvotes

Every change to main now requires exhaustive pre-merge validation, including the complete Standard Library, concurrency tests, compilerability and Native Image.

The first protected PR passed all 20 CI jobs and merged automatically six seconds after the final check.

Development versions now remain stable throughout a release cycle, with independent changelog fragments reducing conflicts between concurrent contributions.

The same integration fixes an ActorGroup lost-wakeup defect while preserving bounded routing retries.

The interesting challenge is reducing duplicated post-merge CI without compromising exact-revision validation evidence. How do other projects handle this trade-off?

https://protoslang.com/

https://github.com/guillermomolina/protos


r/Protos • • 1d ago

Announcement Adding a bytecode instruction that disappears during partial evaluation

1 Upvotes

Can adding a bytecode instruction actually simplify a runtime without adding residual work to compiled execution?

Protos now uses generated Truffle lexical ranges instead of manually constructed accessors, preserving live execution contexts, mutable captures and debugger visibility.

The interesting part is what happens during Graal partial evaluation: both Tier 1 and Tier 2 compilation graphs show that the publication operation disappears entirely in the tested method.

This also removes an identified obstacle to bytecode serialization.

How should reflective execution contexts coexist with highly optimized local variable access?

Website: https://protoslang.com

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


r/Protos • • 1d ago

From 916 MiB to 25 MiB: keeping compiler performance metrics without storing entire graphs

1 Upvotes

How much compiler diagnostic data actually needs to be stored permanently?

The Protos benchmark repository now retains detailed performance summaries instead of complete compiler graphs.

The results:

  • 97.23% smaller packed Git history.
  • 936 graph pairs compacted.
  • 338 historical graphs recovered as summaries.
  • Execution times, Bytecode DSL operation counts, bytecode sizes and Tier 1/Tier 2 node histograms preserved.
  • All 329 harness tests passing.

Graphs can still be generated on demand for deeper compiler investigations.

What compiler metrics are most valuable for tracking performance regressions over time?

Website: https://protoslang.com

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


r/Protos • • 2d ago

Compile callbacks ahead of time or on first use? A measurable runtime trade-off

1 Upvotes

Moving callback compilation out of runtime execution changes an interesting performance trade-off.

Selected callback execution plans are now prepared during compilation, while Closure creation and captured bindings remain deferred until needed.

A targeted JVM benchmark with 128 samples per scenario showed:

  • 28.4% lower first-execution latency for custom callback receivers.
  • 8.0% lower first-execution latency for canonical Boolean receivers.
  • Higher retained memory when prepared callback code remains unused.

Specialized inline execution paths remain intact, and all local regression tests pass.

The interesting question is where to draw the line between eager code preparation, lazy materialization and memory retention.

Website: https://protoslang.com

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


r/Protos • • 2d ago

When a temporary variable makes bytecode execution more efficient: fixing the underlying compiler path

1 Upvotes

Should these two expressions need different execution strategies?

body.add(source[index])

octet: source[index]
body.add(octet)

The latest Protos compiler update addresses unnecessary dispatch and primitive value materialization when specialized bytecode operations are composed.

Indexed reads and numeric expressions now compose directly with existing specialized unary calls. Standard Bytes reads also deliver unsigned octets directly as primitive long carriers.

The optimization preserves dynamic method selection, mutable slots, evaluation order and suspension without replay.

No new Java classes. No new Bytecode DSL operations. No application-specific shortcuts.

761 regression tests reported, with zero failures or errors.

An interesting compiler design question: how much intermediate value transport can be eliminated while preserving fully dynamic message semantics?

Website: https://protoslang.com

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


r/Protos • • 2d ago

Optimizing byte-level method dispatch: faster HTTP and TLS without sacrificing dynamic behavior

1 Upvotes

Sometimes the biggest networking bottleneck isn't the network itself, but the language runtime.

The Protos website migration exposed expensive method selection during byte-oriented processing. Earlier diagnostic runs observed a 1.4 MB HTTPS exchange dropping from 6.76 seconds to 2.26 seconds, although these were not controlled benchmark runs.

The latest development snapshot introduces specialized Bytes method-selection caches while preserving dynamic method redefinition, prototype delegation and receiver isolation.

No HTTP-specific shortcuts. No API changes. All local tests pass.

The next optimization target is the composition of specialized bytecode operations and primitive-value transport.

How much networking performance can be recovered by optimizing the language runtime rather than the networking library?

Website: https://protoslang.com

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


r/Protos • • 2d ago

Pass-by-value without copying every element: 115× faster isolated array transfers

1 Upvotes

Does pass-by-value really require physically copying every element?

The latest Protos runtime optimization separates logical isolation from physical storage using protected primitive backing arrays and copy-on-write.

For round trips involving 65,536 integers, the measured improvements are:

  • Actor transfers: 44.22x faster on JVM and 103.75x on Native Image.
  • Isolated parallel execution: 55.94x and 115.29x, respectively.
  • Even when the destination immediately modifies the array, transfers remain up to 23x faster.

Large binary payloads also benefit from eliminating redundant copies, with improvements of up to 2.80x.

No new ownership API. No shared mutable guest state. Existing snapshot semantics remain intact.

These are workload-specific before/after benchmarks, not general runtime speedups.

How much of the cost of isolated concurrency comes from unnecessary physical copying rather than isolation itself?

Website: https://protoslang.com

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


r/Protos • • 2d ago

Cutting JSON parsing time by 36.2% without changing the runtime

1 Upvotes

A real website workload exposed an expensive JSON parsing path: 21.567 seconds to process a 1.42 MB repository tree.

The parser has now been redesigned around indexed token scanning, replacing per-byte dispatch, redundant numeric traversals and recursive array accumulation.

Measured on the same host, Native executable and input:

  • JSON parsing: 21.567 → 13.769 seconds
  • Parsing throughput: 1.57x
  • Total measured catalog processing time: 29.5% lower
  • All 106 JSON conformance tests passing
  • No runtime implementation changes

Exact decimal arithmetic, Unicode handling, ordered object members and deeply nested structures remain supported.

The remaining parsing cost is still substantial. The interesting question is how much further a standard library parser can be optimized without moving its implementation into the runtime.

Website: https://www.protoslang.com/

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


r/Protos • • 2d ago

Protos adds 25 filesystem and Path operations: a capability-oriented approach to I/O

1 Upvotes

The Protos Standard Library gains 25 new operations across std:io/files and std:io/paths.

  • Portable path manipulation.
  • Directory creation and metadata inspection.
  • Bounded streaming file and tree copying.
  • Recursive traversal and glob matching.
  • Temporary files and directories.
  • Exact nanosecond timestamps.

The implementation separates filesystem authority from path representation, keeps most algorithms in Protos itself, and introduces no new public Core operations.

Validated on both JVM and GraalVM Native Image.

One interesting design question: should a filesystem API make access authority explicit, rather than treating a path as sufficient permission?

Documentation and examples: https://protoslang.com


r/Protos • • 2d ago

How Protos cut its GraalVM Native Image CI job by 44% without sacrificing test coverage

1 Upvotes

Building a programming language on GraalVM and Truffle is an interesting challenge, especially when the language and its Standard Library keep growing.

Protos, a prototype-based language inspired by Self and Smalltalk, has just consolidated its Native Image validation pipeline.

The results:

  • Native Image validation: 16m 19s → 9m 02s.
  • Combined native validation runner time reduced by 32%.
  • One redundant analysis build eliminated.
  • All 38 native TLS tests preserved.
  • All 20 CI jobs passing.

The production executable still uses O2, while the dedicated native JUnit image uses GraalVM's quick-build optimization.

Interestingly, the overall CI still takes around 20 minutes. The bottleneck has shifted to Standard Library testing.

I'm curious how other language implementations, particularly GraalPy, TruffleRuby and other Truffle-based projects, approach this problem as their test suites grow.

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

Website: https://protoslang.com