Hilbert curve but in Rust for j2kun/pmpf-code

Overview

About this code

This repository contains code for matrix multiplication using Hilbert Curves.

The original code (2) is part of @j2kun's code for his next book 3. It was written in Python -- but Python did not show the expected performance benefit of using the Hilbert Curve for matrix multiplication (as compared to a naive multiplication).

Thus I decided to give it a go in a compiled language.

How to run

  1. Install a Rust toolchain from here: https://rustup.rs
  2. Run cargo run --release
  3. Observe the following output:
Initial data generation: 0.061384752s
hilbert data preprocessing: 0.21851613s
Naive: 0.0115141s (0.0005757049999999999s per)
Hilbert: 0.0090037s (0.000450185 s per)
Improvement: 21.802833048175707%

(Tested on my M1 Macbook Air, RustC 1.56.0)

Apple Silicon devices

There is a feature flag, called macos-perf, which provides more details on macOS M1-based computers.

Run: sudo cargo run --features macos-perf --release --quiet --bin example to see more detailed results.

You might also like...
A trash-cli copy, but this time in Rust.

trash-rs A trash-cli copy, but this time in Rust. TODO Deletion Relative paths * functionality List files Include in Metadata: Original directory Date

Just a UNIX's cat copy, but less bloated and in Rust.
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

Store your transfer.sh links, so you can remember them later and know when they will expire, but now written in Rust.

Transfer.sh helper Rusted The idea of the script is to store your transfer.sh links and simplify its usage, so you can remember them later and know wh

Like Lua, but in Rust, and different

AirScript It's like Lua, but in Rust, and different. Introduction AirScript is a dynamically typed, interpreted language inspired by Lua and written i

Rust, but longer

Rusticle Do Rust's short keywords confuse you? Are you tired of Rust not being verbose enough? Or worrying you are not using your new shiny mechanical

Simple but convenient CLI-based Matrix client app for sending and receiving (in Rust)

matrix-commander-rs simple but convenient CLI-based Matrix client app for sending and receiving Help create this Rust program! This project is current

Gamehacking.Academy but made with Rust

Just the programs etc. i made following the lessons on gamehacking.academy but instead of using the cpp i tried translating it to Rust

SA-MP client server list fix but written in Rust

Server List Fix This is a samp client server list fix, which reroutes the client's request to list.sa-mp.com to sam.markski.ar. The idea is originally

`cal` (but better!) in rust

cal-rs cal-rs is a simple command-line calendar application written in Rust. It allows you to display a calendar for a specific month and year, with o

Owner
Christoph Siedentop
Christoph Siedentop
launchpad smart contract create token, bonding curve, pool creation on solana

Tokenix Smart Contract This repository contains the smart contract for Tokenix, a launchpad project currently under development at https://tokenix.fin

null 3 Aug 20, 2024
batch eval tool for machine code. eval() but for asm.

yaxpeax-eval yaxpeax-eval is the repo providing yaxeval, a tool to execute machine code with preconditions and report state at exit. currently, yaxeva

iximeow 10 Jan 5, 2023
ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code. It accepts a local path to a folder containing code, and generates a review for each file in the folder and its subdirectories.

Greg P. 15 Apr 22, 2023
languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments!

languagetool-code-comments integrates the LanguageTool API to parse, spell check, and correct the grammar of your code comments! Overview Install MacO

Dustin Blackman 17 Dec 25, 2022
Code-shape is a tool for extracting definitions from source code files

Code-shape Code-shape is a tool that uses Tree-sitter to extract a shape of code definitions from a source code file. The tool uses the same language

Andrew Hlynskyi 3 Apr 21, 2023
rehype plugin to use tree-sitter to highlight code in pre code blocks

rehype-tree-sitter rehype plugin to use tree-sitter to highlight code in <pre><code> blocks Contents What is this? When should I use this? Install Use

null 5 Jul 25, 2023
World's first, but possibly worst, blinky for the pico in Rust

pico-blink-rs Running Rust code on the Raspberry Pi Pico Booting The RP2040 has external QSPI flash. There is an internal mask-ROM bootloader which ca

rp-rs 129 Dec 24, 2022
du + rust = dust. Like du but more intuitive.

Dust du + rust = dust. Like du but more intuitive. Why Because I want an easy way to see where my disk is being used. Demo Install Cargo cargo install

andy.boot 5.4k Jan 4, 2023
Rmatrix is similar to the cmatrix, but it wrote it in Rust.

Rmatrix is similar to the cmatrix, but it wrote it in Rust. Get up to 75% performance improvement compared to cmatrix.

null 8 Apr 8, 2022
A cli based pastebin in Rust, but very insecure

pasta A cli based pastebin in Rust, but very insecure Use nightly toolchain to build rustup override set nightly When this program is running, you can

Snehit Sah 3 Mar 25, 2022