jest_rust, build, bench

This commit is contained in:
Jest Dotty 2025-03-23 20:03:09 -04:00
parent c1a97c01f5
commit c2fae46865
11 changed files with 269 additions and 2 deletions

3
.gitignore vendored
View File

@ -7,6 +7,7 @@ __pycache__
target
isspam
risspam
/jisspam
isspam_cpp
.build-trigger-2014-12-02 15:26
borded_cpp_exec
borded_cpp_exec

View File

@ -1,7 +1,7 @@
CC = gcc
CFLAGS = -Ofast
all: build run valgrind build_risspam run_risspam build_cpp build_borded_cpp build_py
all: build run valgrind build_risspam run_risspam build_cpp build_borded_cpp build_py build_jest
build:
@echo "Compiling retoor_c project.".
@ -23,6 +23,10 @@ build_risspam:
@echo "Compiling 12bitfloat_risspam project."
cd 12bitfloat_rust/risspam && cargo run --release && cp target/release/risspam ../../
build_jest:
@echo "compiling jest_rust project"
cd jest_rust/jisspam && cargo build --release && cp target/release/jisspam ../../
run: run_spam wl run_not_spam
run_risspam: run_spam_risspam run_not_spam_risspam

View File

@ -15,6 +15,9 @@ time_start = time.time()
subprocess.check_output('./borded_cpp_exec books/*.txt', shell=True)
print("Time Borded CPP:",time.time() - time_start)
time_start = time.time()
subprocess.check_output('./jisspam books/*.txt', shell=True)
print("Time Jest Rust:", time.time() - time_start)
time_start = time.time()
subprocess.check_output('python3 isspam.py books/*.txt', shell=True)
print("Time Retoor Python:",time.time() - time_start)
print("***end benchmark***")

2
jest_rust/jisspam/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
/Cargo.lock

View File

@ -0,0 +1,6 @@
[package]
name = "jisspam"
version = "0.1.0"
edition = "2024"
[dependencies]

View File

@ -0,0 +1,53 @@
`cd jestdotty_rust/jisspam && cargo run --release && cp target/release/jisspam ../../`
for https://retoor.molodetz.nl/retoor/isspam
some older benchmarks to know what to beat, or something:
```
Time C: 11.447573184967041
Time Rust: 1.2248871326446533
Time CPP: 2.1745784282684326
Time Borded CPP: 1.4606633186340332
Time Retoor Python: 38.008224964141846
Time C: 10.476306915283203
Time Rust: 1.1816489696502686
Time CPP: 2.030345916748047
Time Borded CPP: 0.6507000923156738
Time Rust: 1.1833229064941406
Time C: 10.77005124092102
Time CPP: 2.075010061264038
Time Borded CPP: 0.8050553798675537
Time Retoor Python: 39.06818628311157
Time Rust: 1.187262773513794
Time C: 10.271284818649292
Time CPP: 2.0337636470794678
Time Borded CPP: 0.7784948348999023
Time Retoor Python: 37.15883994102478
Time Rust: 1.239715337753296
Time C: 11.51186990737915
Time CPP: 2.085871934890747
Time Borded CPP: 0.6888203620910645
Time Retoor Python: 35.5970196723938
```
https://snek.molodetz.nl/terminal.html ubuntu running thing instructions:
```
mkdir /project
cd /project
git clone https://retoor.molodetz.nl/retoor/isspam.git
apt install valgrind curl
export RUSTUP_HOME=/project/.rustup
export CARGO_HOME=/project/.cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "/project/.cargo/env"
cd isspam
rustup install nightly
rustup default nightly
make
make benchmark
python3 bench.py
```

View File

@ -0,0 +1,167 @@
use std::{env, fmt::Display, fs};
static FORBIDDEN_WORDS: &'static [&'static str] = &[
"recovery",
"techie",
"http",
"https",
"digital",
"hack",
"::",
"//",
"@",
"com",
"crypto",
"bitcoin",
"wallet",
"hacker",
"welcome",
"whatsapp",
"email",
"cryptocurrency",
"stolen",
"freeze",
"quick",
"crucial",
"tracing",
"scammers",
"expers",
"hire",
"century",
"transaction",
"essential",
"managing",
"contact",
"contacting",
"understanding",
"assets",
"funds",
];
#[derive(Debug, Default)]
struct Stats {
file_count: u32,
failed_file_count: u32,
sentence_count: u32,
word_count: u32,
capitalized_count: u32,
numeric_count: u32,
forbidden_count: u32,
}
impl Display for Stats {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "file count: {}", self.file_count)?;
writeln!(f, "failed file count: {}", self.failed_file_count)?;
writeln!(f, "sentence count: {}", self.sentence_count)?;
writeln!(f, "word count: {}", self.word_count)?;
writeln!(f, "capitalized count: {}", self.capitalized_count)?;
writeln!(f, "numeric count: {}", self.numeric_count)?;
writeln!(f, "forbidden count: {}", self.forbidden_count)?;
let word_count = self.word_count as f32;
writeln!(
f,
"words per sentence average: {:.1}",
word_count / self.sentence_count as f32
)?;
writeln!(
f,
"forbidden word percentage: {:.0}%",
(self.forbidden_count as f32 / word_count) * 100.0,
)?;
write!(
f,
"capitalized word percentage: {:.0}%",
(self.capitalized_count as f32 / word_count) * 100.0,
)
}
}
fn main() {
let files = env::args().skip(1);
let mut stats = Stats::default();
for file in files {
let Ok(text) = fs::read_to_string(&file) else {
stats.failed_file_count += 1;
continue;
};
stats.file_count += 1;
for sentence in text
.split('.')
.map(|s| s.trim())
.filter(|s| !s.is_empty())
{
stats.sentence_count += 1;
for word in sentence
.split_whitespace()
.map(|s| s.trim())
.filter(|s| !s.is_empty())
{
stats.word_count += 1;
//get all numbers counted
let mut all_capitalized = true;
for char in word.chars() {
if char.is_numeric() {
stats.numeric_count += 1;
}
if !char.is_ascii_uppercase() {
all_capitalized = false;
}
}
if all_capitalized {
stats.capitalized_count += 1;
}
let lowercase_word = word.to_lowercase();
for forbidden_word in FORBIDDEN_WORDS {
if lowercase_word.contains(forbidden_word) {
stats.forbidden_count += 1;
}
}
}
}
}
println!("{stats}");
}
#[test]
fn test() {
use std::{env, fs, process::Command, time::Instant};
println!("cwd: {}", env::current_dir().unwrap().display());
//compile
let mut compile = Command::new("cargo");
let compile_arged = compile.arg("build").arg("--release");
match compile_arged.output() {
Ok(output) => println!("compiled {}", String::from_utf8_lossy(&output.stdout)),
Err(err) => eprintln!("compile failed: {err}"),
}
//get test files
let files = fs::read_dir("test_files")
.unwrap()
.map(|f| {
f.unwrap()
.path()
.canonicalize()
.unwrap()
.to_str()
.unwrap()
.to_string()
})
.collect::<Vec<_>>();
println!("test files found: {:#?}", files);
//benchmark run
let benchmark = Instant::now();
let mut run = Command::new("target/release/jisspam");
let run_arged = run.args(files);
match run_arged.output() {
Ok(output) => println!("{}", String::from_utf8_lossy(&output.stdout)),
Err(err) => eprintln!("run failed: {err}"),
}
println!("benchmark: {}ms", benchmark.elapsed().as_millis());
}

View File

@ -0,0 +1 @@
I am Nastya and downvoted this post because post is considered spam. Your message will be removed from this community site due too much downvotes. See my profile for more information. Read my source code mentioned on my profile to see what you did wrong. Should be no problem for a developer.

View File

@ -0,0 +1,20 @@
HIRE Century Web Recovery TO RECOVER YOUR LOST BITCOIN
If youve lost your Bitcoin to an online scam, hiring a professional recovery service can significantly improve your chances of getting your funds back. Century Web Recovery specializes in Bitcoin recovery, helping victims reclaim their stolen assets. Heres what you need to know:
Understanding the Recovery Process
The recovery process begins with contacting Century Web Recovery. Their team will guide you through the steps necessary to initiate an investigation into your case. Understanding the process is key to managing your expectations.
Documenting Your Case
To facilitate recovery, its essential to document all relevant information regarding the scam. This includes transaction records, wallet addresses, and any communications with the scammer. Century Web Recovery will help you gather this information to build a strong case.
Investigation and Tracking
Once you hire Century Web Recovery, their experts will begin investigating your case. They use sophisticated tools to track the stolen Bitcoin, identifying the paths taken by the scammers. This tracing is crucial for successful recovery.
Freezing Stolen Assets
Quick action is vital in recovering stolen Bitcoin.Century Web Recovery works directly with cryptocurrency exchanges to freeze any stolen assets, preventing the scammers from cashing out your funds. This collaboration is essential for a successful recovery.
Legal Support and Guidance
If necessary, Century Web Recovery can provide legal support. They will guide you on reporting the scam to law enforcement and assist in filing any legal claims. Their expertise in crypto-related cases ensures you receive the best advice on how to proceed.
If youve lost Bitcoin to an online scam, dont hesitate. Hire Century Web Recovery to recover your lost assets and regain your financial security.

View File

@ -0,0 +1,3 @@
Email; digital hack recovery @ techie . com
WhatsApp +19152151930
Website; https : // digital hack recovery . com

View File

@ -0,0 +1,7 @@
TESTED CRYPTOCURRENCY RECOVERY SERVICE \\ DIGITAL HACK RECOVERY
When the devastating reality of lost or stolen Bitcoin strikes, the path to recovery can seem bleak and hopeless. However, the story of DIGITAL HACK RECOVERY stands as a shining beacon of hope, demonstrating the power of perseverance in the face of seemingly insurmountable odds. This specialized service, founded by a team of tenacious experts, has made it their mission to reunite people with their rightful digital assets, no matter how complex or convoluted the situation may be. Through their unwavering dedication and meticulous investigative techniques, DIGITAL HACK RECOVERY has time and again succeeded in tracking down lost Bitcoin, navigating the labyrinthine world of blockchain technology and leveraging their deep understanding of crypto ecosystems. Their success stories are a testament to the resilience of the human spirit, as they've helped individuals regain access to life-changing sums of money that had been presumed lost forever. In an industry rife with uncertainty and risk, DIGITAL HACK RECOVERY has emerged as a trusted ally, guiding clients through the darkness with a steadfast commitment to recovery. By combining cutting-edge digital forensics, strategic partnerships, and a relentless determination to leave no stone unturned, this remarkable organization has earned the gratitude of countless individuals who had resigned themselves to the permanent disappearance of their hard-earned Bitcoin. In a world where the digital landscape can feel overwhelming and unpredictable, DIGITAL HACK RECOVERY stands as a shining example of what can be achieved through perseverance, expertise, and an unwavering belief in the possibility of redemption. I tried everything I could think of. I contacted support forums, tried password recovery tools, scoured Reddit for advice, and spent countless hours following step-by-step guides. Every lead I followed seemed to end in disappointment. I felt like I was chasing an illusion—getting closer, but never quite reaching it. With every attempt that failed, my hope dwindled further. It was an overwhelming feeling, knowing that I had lost something irreplaceable, something I had worked so hard for, and worse—something I had no way of recovering. Months passed, and I was ready to give up. I had accepted that my Bitcoin was gone, lost forever. But that feeling of helplessness lingered, gnawing at me in the back of my mind but DIGITAL HACK RECOVERY made the change of my life when I got the news of the recovery. Thank you very much. Contact them via contact details bellow
Email; digital hack recovery @ techie . com
WhatsApp +19152151930
Website; https : // digital hack recovery . com