u/lokinpendawa

Image 1 — The Performance Magic: SWI-Prolog JITI
Image 2 — The Performance Magic: SWI-Prolog JITI
▲ 3 r/prolog

The Performance Magic: SWI-Prolog JITI

I just completed a massive architectural refactoring on my retail ERP/analytical engine (LOGICBIZ v2.0). We shifted away from traditional query layers into unified, native RAM structures powered entirely by SWI-Prolog.

To be honest, the resulting performance metrics feel completely broken.

The Scale & Data Load

Our database partition currently holds a massive in-memory payload under high global concurrency:

  • detail_transaksi/4: 1,749,235 active transactional item rows.
  • tabel_transaksi/19: 500,000 core financial invoices.
  • Total Volume Handled: IDR 127,424,957,876 (~$8.1 Million USD equivalent).

check out the repository here:
https://github.com/lokinpendawa/logicbiz

u/lokinpendawa — 16 hours ago
▲ 3 r/prolog

FREE DATASET 1.7M+ High-Density Retail Transaction Synthetic

Dataset Specifications & Density

  • Total Master Invoices: 500,000 unique transactions (`tabel_transaksi/19`)
  • Total Item-Slice Logs: 1,749,235 transaction details (`detail_transaksi/4`)
  • Total Net Revenue Volume: 127.4 Billion (Calculated dynamically in-memory)

Format :

  • Pure Prolog Facts (.pl) 185 MB | Ready for logical inference pipelines.
  • Standard Universal JSON (.json) 486 MB | Optimized for modern JavaScript/Python ingestion.
  • Structured SQL Source Code (.sql) 410 MB | Pre-baked with relational schema insertion queries.
  • Microsoft Excel Worksheet (.xlsx) 148 MB | Raw layout for traditional accounting and standard data pivot sheets.

Access the Dataset

https://github.com/lokinpendawa/high-fidelity-pos-dataset-2M

u/lokinpendawa — 3 days ago
▲ 5 r/prolog

Stress-testing a local-first POS pipeline: 10 concurrent cashiers, SQLCipher AES-256 encryption, SHA-256 signatures, resolved at 6.79 TPS on an 8-thread AMD.

Concurrency Stress-Test Results: Local-First Retail POS Engine (SWI-Prolog)

I just concluded a massive concurrency stress-test on my local-first retail POS (Point of Sale) engine. The memory stats from SWI-Prolog are incredibly impressive, proving the extreme resource efficiency of this architecture.

Workload Configuration

The test simulated 10 unique cashier accounts concurrently slamming the system with a combined workload of 100,000 multi-item invoices. Everything routed through the authentic frontend cashier pipeline:

  • Pricing Engine: Calculates item-level dynamic pricing and multi-tiered discounts (Member + Market Basket AI rules).
  • Fiscal & Tax: Multiplies floating-point VAT rules using strict REAL types.
  • Security: Generates a cryptographic SHA-256 active signature per invoice.
  • Data Persistence: Commits transactions asynchronously via SQLCipher 256-bit AES encryption directly to hardware storage using SQLite WAL Mode.

The Refactoring Secret: Single Source of Truth (SSoT)

This extreme memory optimization was achieved by completely deprecating separate history/cashier logs and compressing them into a single, high-density Unified Master Item Ledger (`detail_transaksi/10`). Handled entirely by SWI-Prolog's Just-In-Time Indexing (JITI) map, relational joins are resolved virtually via pointer unification at the RAM layer instead of hitting heavy physical disk joins.

u/lokinpendawa — 10 days ago
▲ 3 r/prolog

Aggregating 521k dynamic invoices in 3.2 seconds, subsequent lookups in 0.0000s via native RAM caching

Calculating total COGS and net revenue from half a million invoices now takes just 3 seconds.
Subsequent clicks are completely instant at 0.0000 seconds thanks to RAM caching.
It turns out keeping the code simple is way faster than overcomplicating it.

Check out the architecture and full project details on my GitHub repository here: https://github.com/lokinpendawa/logicbiz

Ps: Sorry for any grammar mistakes, I am using AI to translate this into English.

u/lokinpendawa — 20 days ago
▲ 12 r/prolog

Everything built natively using Prolog! Soon to be translated into English + releasing a FREE version for the community!

EVERYTHING you see in this screenshot was built 100% natively within SWI-Prolog. No heavy frameworks, no system-taxing UI wrappers.

I want to completely change the outdated stigma that Prolog is only for academic purposes—like family trees or command-line logic puzzles. Currently, the interface is in Indonesian as it is running live for a local neo-retail company's infrastructure, but the good news is that I am working on translating the entire system into English.

You can check out the official architecture roadmap and repository details here:

GitHub: https://github.com/lokinpendawa/logicbiz

Even better, I plan to release a FREE version of this core Prolog engine to the community soon.

For those who want to test the raw data capabilities or audit the dataset structure yourself, I have prepared and uploaded the clean, ISO-compliant 400MB flat text database file (.pl format with parenthesized dynamic predicates) to Google Drive:

Dataset: https://drive.google.com/file/d/1bACN_vVtvka62lWzA1JxXKL2EcoWFDCj/view?usp=sharing

Here is a brief technical overview of what this native Prolog system does behind the scenes:

  1. Native Full-Stack SSR: Every HTML grid, custom CSS layout, and neon cyberpunk-style dashboard is generated directly via Definite Clause Grammars (DCG) from the core memory stack.
  2. Enterprise-Grade Scalability: The system actively manages, aggregates, and filters a live database containing over 2.23 million rows of dynamic transaction facts—all handled entirely in-memory.
  3. Cryptographic Ledger & Security: The system decrypts records in real-time using SQLCipher AES-256 and computes 550 million logic inferences in under 11 minutes to verify daily data integrity signatures using SHA-256.
  4. Native Expert System AI: The Business Intelligence view leverages Prolog's true power as a native inference engine to dynamically calculate inventory turnover, predict dead stock, and automatically provide operational suggestions to cashiers in natural language.

I have only been exploring the declarative nature and the power of homoiconicity in Prolog for about two months, and I am truly amazed by its capabilities as a highly robust full-stack system. Stay tuned for the English version!

Let me know what you think.

Warm regards,

Teddy

u/lokinpendawa — 23 days ago
▲ 15 r/prolog

Who said Prolog is slow? Benchmarking 2 Million In-Memory Transactions with SHA-256 and SQLCipher on SWI-Prolog.

I’m currently building LOGICBIZ v2.0, an Offline-First Enterprise Retail ERP and Sales Ledger Engine engineered 100% using a Pure Declarative Paradigm with SWI-Prolog and SQLCipher.

Here is a quick breakdown of this stress test benchmark:

  • The Task: Performing deep data integrity verification on 2,000,000 real rows of transaction ledgers.
  • The Security: Every single transaction is encrypted via SQLCipher and validated against SHA-256 signatures to ensure absolute data tamper-proofing.
  • The Result: As seen in the console screenshot, the engine evaluated 550,508,812 logical inferences in just 103.28 seconds of raw CPU time.
  • The Kick: Once the Native RAM Cache warm-up phase is completed, executing deep aggregate financial pipelines across those 2 million rows drops down to a jaw-dropping 653 seconds while keeping CPU utilization extremely low at 16%.
  • The engine utilizes Tail-Call Optimization (TCO) and Prolog's native multi-argument indexing structure, meaning it completely eliminates traditional database I/O bottlenecks without requiring heavy, bloated frameworks.

If you are curious about the architecture philosophy, the system manifesto, or want to check out the benchmark metrics, feel free to visit the repository here:

https://github.com/lokinpendawa/logicbiz

Would love to hear your thoughts on using logic programming for heavy enterprise data pipelines!

u/lokinpendawa — 25 days ago
▲ 13 r/prolog

In Memory POS - 100% Built Using SWI Prolog

in memory POS analytics page is built 100% using Prolog, a truly impressive language.

The high-performance, RAM-based Sales Log Matrix page—powered by SWI-Prolog and Native RAM Cache—is capable of sorting and aggregating 2.2 million rows of data in less than 0.6 seconds. More info, check here : https://github.com/lokinpendawa/logicbiz/blob/main/README.md

Note: All metrics and entries displayed above are generated using anonymized, simulated data strictly for stress-testing purposes.

u/lokinpendawa — 28 days ago
▲ 2 r/prolog

Finished SQL Injection: 2M data

CPU AMD FX-8300 (8 Cores), Total RAM 8 GB (Shared with GPU). You can check metrics here:
Mass Data Injection: 2,000,000 rows

The system mailbox queue in 141.08 seconds

speed : 14,176.81 TPS.

github.com
u/lokinpendawa — 29 days ago
▲ 5 r/prolog

Just Finished a local concurrency 100 virtual cashiers @ 1000 transactions

I wanted to share these statistics because I am truly amazed by the efficiency of SWI-Prolog. I run a simulation involving 100 virtual cashiers operating concurrently, processing a total of 100,000 transactions.

- Each transaction was broken down into 5 physical SQL queries dispatched via asynchronous background worker threads.

- The system actively applied SQLCipher AES-256-bit encryption and generated SHA-256 signatures for every invoice.

- The test completed successfully with absolutely no deadlocks over the course of a 3.5-hour cycle.

- Even though my amateur code forced the engine to perform over 64 billion logical inferences...

- Active internal memory usage (Global Stack) hovered around 25 MB (with a 32 MB allocation).

- The temporary internal memory footprint even dipped as low as 1,115 KB.

Check the documentation and performance here: https://github.com/lokinpendawa/logicbiz/blob/main/README.md

Note: All metrics and entries displayed above are generated using anonymized, simulated data strictly for stress-testing purposes.

u/lokinpendawa — 29 days ago

I started learning Prolog from scratch 2 months ago with zero CS background. Just completed a local 100k transaction simulation with 100 concurrent threads, and SWI-Prolog is mind-blowing.

Hey everyone,

A few months ago, I had zero coding background. I wanted to learn programming, but Python and JS felt a bit dry for me. I’ve always loved first-order predicate logic, which eventually led me to stumble upon Prolog. A lot of people laughed and told me it’s a dead language, but I fell in love with it anyway.

Fast forward to today, after lots of trial and error, fixing arities, and using AI to help me debug, I managed to build the core POS engine for my project, LOGICBIZ v2.0.

To see if my beginner-written code could actually hold up under a heavy local workload, I ran an endurance stress test. I am honestly blown away by the results and wanted to share the screenshots:

  • The Simulation: 100 virtual cashiers firing a total of 100,000 transactions simultaneously on a single machine.
  • The Pipeline: Every single transaction triggers 5 physical SQL queries (Induk, Stok, Waktu, Detail, Rekap) handled asynchronously via a background worker thread, while enforcing active SQLCipher 256-bit AES encryption and generating SHA-256 signatures per invoice.
  • The Result: The test finished with ZERO DEADLOCK after 12,574 seconds.

The most insane part for me as a hobbyist is the resource efficiency. Despite executing over 64 billion logical inferences, SWI-Prolog's terminal statistics show active memory usage stayed at just 1,115 KB. My Windows Task Manager also showed CPU hovering around 27% and Disk I/O sitting at 0% because the async worker perfectly absorbed the write spike.

As a complete beginner, achieving this kind of stability and efficiency makes me so proud of choosing Prolog. It’s definitely not an outdated language; it’s a hidden superpower for backend logic.

Would love to hear any thoughts or feedback from the seasoned Prolog devs here!

reddit.com
u/lokinpendawa — 29 days ago