andrestubbe/FastASCII.git

https://github.com/andrestubbe/FastASCII

Adds FastQuadrant and FastSextant as alternative to FastBraille

Daniel Sheffield f886768c1a import all whether used or not hai 8 horas
.github b2e7de293b ci: add GitHub release workflow hai 1 mes
docs 0fd71f701b Auto Update hai 2 meses
examples f886768c1a import all whether used or not hai 8 horas
native d828ad1435 Initial FastASCII commit hai 2 meses
src 493ac0dc88 quadrant and sextant hai 2 semanas
.gitattributes d828ad1435 Initial FastASCII commit hai 2 meses
.gitignore d828ad1435 Initial FastASCII commit hai 2 meses
LICENSE d828ad1435 Initial FastASCII commit hai 2 meses
README.md 42962c1b84 Auto Update hai 2 meses
compile.bat d828ad1435 Initial FastASCII commit hai 2 meses
jitpack.yml d828ad1435 Initial FastASCII commit hai 2 meses
pom.xml 6bd25faf74 Auto Update hai 1 mes
run-benchmark.bat 0acca8b851 Refactor: Move Raymarch demo and FastGlyphDensity from FastANSI hai 2 meses
run-demo-braillie.bat 6bd25faf74 Auto Update hai 1 mes
run-demo.bat 6bd25faf74 Auto Update hai 1 mes
run-speed.bat 6bd25faf74 Auto Update hai 1 mes

README.md

FastASCII 0.1.0 [ALPHA-2026-01-11] — Zero-Allocation ASCII and UTF-8 Byte Engine for Java

Status Java [Platform]() JitPack

⚡ A high-performance, zero-allocation byte processing library for Java, engineered for direct manipulation of primitive byte arrays without the devastating overhead of String instantiation or UTF-16 transcoding.

FastASCII is the foundational byte-level standard library for the FastJava ecosystem.

To achieve a completely responsive, zero-latency parsing and rendering experience, FastASCII is the invisible backbone designed to power the rest of the FastJava ecosystem:

  • FastANSI — Relies on FastASCII for byte-native escape sequence scanning.
  • 🚀 FastTerminal — Uses FastASCII to compose ANSI streams directly to memory for 60+ FPS rendering.
  • 🖱️ FastMouse — Depends on FastASCII for ultra-fast integer tracking directly from standard input.

Watch the Demo


FastASCII Showcase


// Quick Start — Example

import fastascii.FastASCIIWriter;
import fastascii.FastASCIIReader;

public class Demo {
    public static void main(String[] args) {
        byte[] buffer = new byte[1024];
        
        // Write integers directly to bytes (Zero Allocation!)
        int bytesWritten = FastASCIIWriter.writeInt(buffer, 0, 404);
        
        // Write UTF-8 codepoints natively
        bytesWritten += FastASCIIWriter.writeUtf8(buffer, bytesWritten, 0x1F680); // 🚀

        // Parse unsigned integers blazingly fast
        int parsed = FastASCIIReader.parseUInt(buffer, 0, 3);
        System.out.println("Parsed: " + parsed);
    }
}

Table of Contents


Why FastASCII?

The mission is to build the fastest, most robust byte manipulation kernel on the JVM. Java's standard library forces expensive String allocations and UTF-8 to UTF-16 conversions that destroy performance in hot loops. FastASCII operates exclusively on primitives, empowering developers to create parsers and renderers that redefine Java performance by pushing the absolute limits of the HotSpot JIT compiler.


Key Features

  • 🚫 Zero Allocations — Bypasses all String, StringBuilder, and Matcher instantiations.
  • ⚡ JIT-Optimized Java — The core layer is pure Java, written specifically to trigger aggressive HotSpot compiler inlining for small buffers (like ANSI codes).
  • 🌐 Native UTF-8 Encoding — Validates, encodes, and decodes UTF-8 codepoints natively at blazing speeds.
  • 🎯 Universal Parsers — Built-in highly-optimized scalar search functions for indexOf, whitespace skipping, and integer parsing.

API Quick Reference

Method Description Component
writeInt(buffer, offset, value) Writes an integer directly into a byte buffer. FastASCIIWriter
writeUtf8(buffer, offset, cp) Encodes a codepoint directly to UTF-8 bytes. FastASCIIWriter
parseUInt(buffer, start, end) Blazing fast unsigned integer parsing from bytes. FastASCIIReader
find(haystack, offset, len, needle) Zero-allocation indexOf replacement. FastASCIIScanner
decodeCodePoint(buf, off, len, out) High-throughput UTF-8 to UTF-32 decoding. FastUTF8

Installation

Option 1: Maven (Recommended)

Add the JitPack repository and the dependencies to your pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <!-- FastASCII Library -->
    <dependency>
        <groupId>com.github.andrestubbe</groupId>
        <artifactId>fastascii</artifactId>
        <version>0.1.0</version>
    </dependency>

</dependencies>

Option 2: Gradle (via JitPack)

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.andrestubbe:fastascii:0.1.0'
}

Option 3: Direct Download (No Build Tool)

Download the latest JARs directly to add them to your classpath:

  1. 📦 fastascii-0.1.0.jar (The Core Library)

License

MIT License — See LICENSE file for details.


Related Projects


Part of the FastJava EcosystemMaking the JVM faster. Small package. Maximum speed. Zero bloat. 🚀💎