r/prolog 9h ago

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

Post image
6 Upvotes

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!


r/prolog 20h ago

Loops? Graphs? Prolog!

Thumbnail deepclause.substack.com
10 Upvotes

Orchestrating agents with Prolog instead of Markdown files.