# Optimization

**URL:** https://revolt.metaeducation.com/forum/c/development/optimization/53.md

[Latest](https://revolt.metaeducation.com/forum/latest.md) · [Categories](https://revolt.metaeducation.com/forum/categories.md) · [Tags](https://revolt.metaeducation.com/forum/tags.md)

---

## [About the Optimization category](https://revolt.metaeducation.com/forum/t/about-the-optimization-category/1670)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0

</div>

This is a category for discussing performance and optimization ideas. Though remember the very important Rules For Optimizations (at least, the Ones Make Code Less Clear): Rule #1: Don't do it. Rule #2: (Experts only!)…

---

## [Incomplete TRANSCODEs: Actually an Optimization Problem](https://revolt.metaeducation.com/forum/t/incomplete-transcodes-actually-an-optimization-problem/1940)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [September 14, 2026, 7:58am UTC](https://revolt.metaeducation.com/forum/t/incomplete-transcodes-actually-an-optimization-problem/1940 "2026-09-14T07:58:54Z")

</div>

Revolt has a multi-return interface for TRANSCODE. Without /NEXT, you get the whole thing: \>\> transcode "abc def" == \[abc def\] With the /NEXT refinement, it will go one item at a time. But the return convention is th…

---

## [Optimizing By Treating QUOTED! Items As A Container](https://revolt.metaeducation.com/forum/t/optimizing-by-treating-quoted-items-as-a-container/2609)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 2\
**Last updated:** [March 23, 2026, 3:51pm UTC](https://revolt.metaeducation.com/forum/t/optimizing-by-treating-quoted-items-as-a-container/2609 "2026-03-23T15:51:25Z")

</div>

There's a cost difference between: \>\> data: quote first \[a b c\] == 'a \>\> data: blockify first \[a\] == \[a\] Adding a quote level just bumps a number in a byte of a Cell. Whereas making a BLOCK! requires creating a whole…

---

## [Issues With Writing Output Cells Directly](https://revolt.metaeducation.com/forum/t/issues-with-writing-output-cells-directly/2366)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 2\
**Last updated:** [March 14, 2026, 1:59pm UTC](https://revolt.metaeducation.com/forum/t/issues-with-writing-output-cells-directly/2366 "2026-03-14T13:59:32Z")

</div>

How R3-Alpha Natives Returned Their Result The protocol for return result for natives in R3-Alpha was that an enumerated type said where the output result could be found: enum { R\_RET = 0, R\_TOS, R\_TOS1, R\_NONE, R\_…

---

## [Performance and Tradeoffs of Enum Inheritance in C++](https://revolt.metaeducation.com/forum/t/performance-and-tradeoffs-of-enum-inheritance-in-c/2690)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [February 22, 2026, 1:13pm UTC](https://revolt.metaeducation.com/forum/t/performance-and-tradeoffs-of-enum-inheritance-in-c/2690 "2026-02-22T13:13:16Z")

</div>

I have some methods that allow the "Heart" of a Cell to be a subset of the total legal types (e.g. a QUOTED! cell doesn't have a 'quoted' heart, it has whatever the heart of the quoted thing is... hence TYPE\_QUOTED and T…

---

## [Killing the Last "Skip The Stepper" Optimizations](https://revolt.metaeducation.com/forum/t/killing-the-last-skip-the-stepper-optimizations/2684)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [February 10, 2026, 10:07pm UTC](https://revolt.metaeducation.com/forum/t/killing-the-last-skip-the-stepper-optimizations/2684 "2026-02-10T22:07:33Z")

</div>

It has always seemed very tempting to try and speed up the evaluator by not doing recursions of the evaluator. For instance: if you're filling the arguments for a call to something like IF, and you see the condition is …

---

## [FINAL Helping Optimization For Infix](https://revolt.metaeducation.com/forum/t/final-helping-optimization-for-infix/2682)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [February 9, 2026, 2:14pm UTC](https://revolt.metaeducation.com/forum/t/final-helping-optimization-for-infix/2682 "2026-02-09T14:14:17Z")

</div>

This feature can help with the performance/semantics of INFIX dispatch. Background There has historically been an optimization which, where if you say something like: foo: does \[print "foo" 1000\] bar: does \[print "b…

---

## [Progress on Nativizing Parser Combinators](https://revolt.metaeducation.com/forum/t/progress-on-nativizing-parser-combinators/1636)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [January 30, 2026, 1:52am UTC](https://revolt.metaeducation.com/forum/t/progress-on-nativizing-parser-combinators/1636 "2026-01-30T01:52:14Z")

</div>

So... let's start with a virtual machine I have...where r3-alpha gets this time for a rather simple parse operation: r3-alpha\>\> delta-time \[ parse "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \[ some \[opt "c" opt…

---

## [Canonizing Holes To NULL vs. Leaving Them As Is](https://revolt.metaeducation.com/forum/t/canonizing-holes-to-null-vs-leaving-them-as-is/2660)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [January 25, 2026, 5:09pm UTC](https://revolt.metaeducation.com/forum/t/canonizing-holes-to-null-vs-leaving-them-as-is/2660 "2026-01-25T17:09:21Z")

</div>

In talking about why I liked the idea of standardizing NULL as the "unspecialized default state", I pointed out some displeasing code: for (; key != key\_tail; ++key, ++param, ++arg) { if (Is\_Specialized(param)) …

---

## [Stopping the /INTO Virus](https://revolt.metaeducation.com/forum/t/stopping-the-into-virus/705)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 4\
**Last updated:** [January 8, 2026, 6:30am UTC](https://revolt.metaeducation.com/forum/t/stopping-the-into-virus/705 "2026-01-08T06:30:36Z")

</div>

In R3-Alpha, an /INTO option was added to REDUCE and COMPOSE. It blended the functionality of INSERT into these routines, so as to avoid the overhead of creating an intermediate series that would just be thrown away: \>\>…

---

## [Taking $VARIABLES To Fold Mutation Into A Native For Speed](https://revolt.metaeducation.com/forum/t/taking-variables-to-fold-mutation-into-a-native-for-speed/2611)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [January 4, 2026, 12:49am UTC](https://revolt.metaeducation.com/forum/t/taking-variables-to-fold-mutation-into-a-native-for-speed/2611 "2026-01-04T00:49:14Z")

</div>

I've spoken about the need to optimize the GLOM function, which is a critical piece of UPARSE. Because GLOM was "append-like" it would take SPLICE! or single values. But I realized that when speaking the language of hi…

---

## [Making ARROW Functions Cheaper](https://revolt.metaeducation.com/forum/t/making-arrow-functions-cheaper/2616)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 2\
**Last updated:** [December 31, 2025, 10:18pm UTC](https://revolt.metaeducation.com/forum/t/making-arrow-functions-cheaper/2616 "2025-12-31T22:18:56Z")

</div>

To recap: eval code except e -\> \[...\] ; method A ; ...vs... eval code except (e -\> \[...\]) ; method B The technical trickery that pulls off \[A\] has been a showpiece, though also a thorn. And while the arrow functi…

---

## [Bypassing Type Checking: Quoted Type Specs](https://revolt.metaeducation.com/forum/t/bypassing-type-checking-quoted-type-specs/2624)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [December 30, 2025, 8:30am UTC](https://revolt.metaeducation.com/forum/t/bypassing-type-checking-quoted-type-specs/2624 "2025-12-30T08:30:17Z")

</div>

I've started being more verbose in type specs, putting in string descriptions of what each type means, it's getting detailed: // // for-each: native \[ // // "Evaluates a block for each value(s) in a series" // // …

---

## [Semantics and Optimization of Copying Function Bodies](https://revolt.metaeducation.com/forum/t/semantics-and-optimization-of-copying-function-bodies/2119)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 6\
**Last updated:** [December 28, 2025, 4:52am UTC](https://revolt.metaeducation.com/forum/t/semantics-and-optimization-of-copying-function-bodies/2119 "2025-12-28T04:52:25Z")

</div>

Part of Rebol's design is that every execution frame has an order to its arguments, represented by an integer. So for instance with IF: the CONDITION would be in frame cell\[1\] the BRANCH would be in frame cell\[2\] NAT…

---

## [Should COMMA! Have An Eval Step?](https://revolt.metaeducation.com/forum/t/should-comma-have-an-eval-step/2591)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [December 9, 2025, 8:02pm UTC](https://revolt.metaeducation.com/forum/t/should-comma-have-an-eval-step/2591 "2025-12-09T20:02:31Z")

</div>

The COMMA! type is pretty great, and I would definitely be displeased if it went away. https://revolt.metaeducation.com/forum/t/the-language-worlds-weirdest-comma-mechanic/1387 But how to handle it in the evaluator has…

---

## [Avoiding Unnecessary Merging Through SPLICE!](https://revolt.metaeducation.com/forum/t/avoiding-unnecessary-merging-through-splice/2575)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [November 30, 2025, 4:18pm UTC](https://revolt.metaeducation.com/forum/t/avoiding-unnecessary-merging-through-splice/2575 "2025-11-30T16:18:16Z")

</div>

The SPLICE! antiform could give us some pretty interesting options for avoiding the creation of series that we don't need. Here's something that doesn't work today (because FIND hasn't implemented it), but it could be m…

---

## [PATH! + TUPLE! + CHAIN! compression, explained](https://revolt.metaeducation.com/forum/t/path-tuple-chain-compression-explained/1008)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 2\
**Last updated:** [October 24, 2025, 9:23am UTC](https://revolt.metaeducation.com/forum/t/path-tuple-chain-compression-explained/1008 "2025-10-24T09:23:56Z")

</div>

Since I ever saw them, I wanted to unify PATH! and REFINEMENT! It did not make sense to me that there was foo/bar and /bar but not /foo/bar or bar/ I pretty quickly landed on the idea that if you saw something like…

---

## [Optimizing 1-Element PACK!s / SPLICE!s](https://revolt.metaeducation.com/forum/t/optimizing-1-element-pack-s-splice-s/2516)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [July 25, 2025, 5:41pm UTC](https://revolt.metaeducation.com/forum/t/optimizing-1-element-pack-s-splice-s/2516 "2025-07-25T17:41:50Z")

</div>

Historically the most common type of PACK! is the 1-element PACK! holding a ~NULL~ antiform, that you get when a branching statement takes the branch and evaluates to null. It's not supposed to be the case that antiform…

---

## [Impedance Matching LIFT The Universe With Baseline](https://revolt.metaeducation.com/forum/t/impedance-matching-lift-the-universe-with-baseline/2483)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 5\
**Last updated:** [June 25, 2025, 8:01am UTC](https://revolt.metaeducation.com/forum/t/impedance-matching-lift-the-universe-with-baseline/2483 "2025-06-25T08:01:46Z")

</div>

(Sorry for the EE term. If you're unfamiliar: Impedance Matching) A while back I realized that it's best if OBJECT!s, MODULE!s, LET!s, etc. store their contents in lifted representation. ...or rather... they store "h…

---

## [Beating REPEND: A New Parameter Convention?](https://revolt.metaeducation.com/forum/t/beating-repend-a-new-parameter-convention/1673)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [September 2, 2022, 11:14am UTC](https://revolt.metaeducation.com/forum/t/beating-repend-a-new-parameter-convention/1673 "2022-09-02T11:14:23Z")

</div>

When you do an append a reduce b, the REDUCE generates a new series... let's call it rb. Then rb is spliced into a. And then rb needs to be GC'd. The idea behind repend a b is that you never make rb. Instead, express…

---

## ["Sub-Cell" Addressing In DATE! and TIME!](https://revolt.metaeducation.com/forum/t/sub-cell-addressing-in-date-and-time/1765)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 2\
**Last updated:** [December 4, 2021, 5:39pm UTC](https://revolt.metaeducation.com/forum/t/sub-cell-addressing-in-date-and-time/1765 "2021-12-04T17:39:24Z")

</div>

As we are familiar, DATE! can have a TIME! component: \>\> d: now == 21-Nov-2021/18:56:45-5:00 \>\> type of d == #\[datatype! date!\] \>\> t: d.time == 18:56:45 \>\> type of t == #\[datatype! time!\] Although TIME! can exist a…

---

## [Weird Optimization History: CELL\_FLAG\_FALSEY](https://revolt.metaeducation.com/forum/t/weird-optimization-history-cell-flag-falsey/2420)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [April 18, 2025, 11:49pm UTC](https://revolt.metaeducation.com/forum/t/weird-optimization-history-cell-flag-falsey/2420 "2025-04-18T23:49:45Z")

</div>

In the very, very early times of Revolt, there was no QUOTE\_BYTE chewing 8 bits out of the header. So CELL\_FLAG\_XXX were more plentiful in the remaining header space. Because they were so plentiful, it was picked to us…

---

## [Agreed Upon Symbol Numbers for Extensions](https://revolt.metaeducation.com/forum/t/agreed-upon-symbol-numbers-for-extensions/1188)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [March 27, 2025, 8:04pm UTC](https://revolt.metaeducation.com/forum/t/agreed-upon-symbol-numbers-for-extensions/1188 "2025-03-27T20:04:56Z")

</div>

A concept in the R3-Alpha codebase is that there are a certain number of built-in words...which come from a file called %words.r https://github.com/rebol/rebol/blob/master/src/boot/words.r This is done so you can switc…

---

## [Flexible Symbol Reordering for Optimization](https://revolt.metaeducation.com/forum/t/flexible-symbol-reordering-for-optimization/2372)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [March 18, 2025, 12:58pm UTC](https://revolt.metaeducation.com/forum/t/flexible-symbol-reordering-for-optimization/2372 "2025-03-18T12:58:51Z")

</div>

In the original formulation of building the symbol table, it kept a running count of the current symbol ID, and incremented it as it went. The order wasn't always random. For instance, one of the optimizations based on…

---

## [Further Optimizations Of Breaking the 64-Type Barrier](https://revolt.metaeducation.com/forum/t/further-optimizations-of-breaking-the-64-type-barrier/2369)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [March 16, 2025, 8:57pm UTC](https://revolt.metaeducation.com/forum/t/further-optimizations-of-breaking-the-64-type-barrier/2369 "2025-03-16T20:57:14Z")

</div>

Historical Rebol/Red are limited to 64 datatypes. It's not because there isn't space in the cells to store more (e.g. 256 in a header byte) -- but because TYPESET! wanted to fit into a Cell's payload, as a 64-bit intege…

---

## [Performance Implications of Antiform-FRAME!-is-Action](https://revolt.metaeducation.com/forum/t/performance-implications-of-antiform-frame-is-action/2083)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 4\
**Last updated:** [December 9, 2024, 9:07am UTC](https://revolt.metaeducation.com/forum/t/performance-implications-of-antiform-frame-is-action/2083 "2024-12-09T09:07:11Z")

</div>

Making the antiform state of frames be "interpret this frame as an action when referenced through a WORD!" is a deep change. The implications haven't been fully absorbed, and there are some things I noticed that create …

---

## [The Probably-False Economy of EVAL Consuming FRAME!](https://revolt.metaeducation.com/forum/t/the-probably-false-economy-of-eval-consuming-frame/2339)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [December 1, 2024, 12:50am UTC](https://revolt.metaeducation.com/forum/t/the-probably-false-economy-of-eval-consuming-frame/2339 "2024-12-01T00:50:53Z")

</div>

The earliest design usages for FRAME! were for things like ENCLOSE. ENCLOSE builds the frame for the function you're enclosing, then passes the frame to a function that can manipulate the frame, and invoke it with EVAL …

---

## [Intrinsics: Functions without Frames](https://revolt.metaeducation.com/forum/t/intrinsics-functions-without-frames/2050)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 1\
**Last updated:** [November 9, 2024, 5:59pm UTC](https://revolt.metaeducation.com/forum/t/intrinsics-functions-without-frames/2050 "2024-11-09T17:59:24Z")

</div>

Redbol's historical type system really had only one design point: be fast. There were 64 fundamental datatypes, and parameters of a function could either accept each datatype or not. So a simple bitset of 64 bits was s…

---

## [A Pattern-Matching Optimized MAP (?)](https://revolt.metaeducation.com/forum/t/a-pattern-matching-optimized-map/2302)

<div class="topic-metadata">

**Author:** [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Replies:** 0\
**Last updated:** [September 28, 2024, 11:35pm UTC](https://revolt.metaeducation.com/forum/t/a-pattern-matching-optimized-map/2302 "2024-09-28T23:35:31Z")

</div>

In UPARSE, there's a MAP! of all the combinators. You can map fundamental datatypes to combinator functions, or you can map literal elements to combinator functions (as keywords like SOME or ACROSS are)... or you can ma…

---

## [Speed of UPARSE](https://revolt.metaeducation.com/forum/t/speed-of-uparse/2177)

<div class="topic-metadata">

**Author:** [@bradrn](https://revolt.metaeducation.com/forum/u/bradrn)\
**Replies:** 5\
**Last updated:** [March 30, 2024, 2:56pm UTC](https://revolt.metaeducation.com/forum/t/speed-of-uparse/2177 "2024-03-30T14:56:44Z")

</div>

I’m just wondering if any benchmarking has been done on UPARSE. How does it compare to PARSE in Red or in Rebol? Or to parser combinators in Haskell? For that matter, how does it compare to an ordinary recursive-descent …

[Next page](https://revolt.metaeducation.com/forum/c/development/optimization/53.md?page=1)
