You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using sevenz-rust version 0.4.3, with Rust 1.71 on Windows. I am using the code below:
`
use std::path::{Path, PathBuf};
use std::fs::{File,OpenOptions};
use sevenz_rust::lzma::{LZMA2Options ,LZMA2Reader,LZMA2Writer};
use sevenz_rust::{SevenZReader, SevenZWriter, Password, SevenZArchiveEntry};
use std::{process::exit};
use std::time::Instant;
fn main() {
let verb_duration=Instant::now();
let file_name="testdir\folder1\file3.txt";
let file_path=PathBuf::from(file_name);
let archive_path=PathBuf::from("test.7z");
let file_handle = File::create(archive_path).unwrap();
let mut zip:SevenZWriter<File>;
let res_zipwriter=SevenZWriter::new(file_handle);
match res_zipwriter {
Ok(z)=>{zip=z;}
Err(e)=>{exit(1)}
}
let entry_name=file_name.replace("\\", "/");
let zipentry= SevenZArchiveEntry::from_path(file_path.clone(),entry_name);
let file_handle=File::open(file_path.clone()).unwrap();
let res_write=zip.push_archive_entry(zipentry,Some(file_handle));
zip.finish();
println!("{:?}",verb_duration.elapsed());
}
`
file3.txt is a 50MB text file and above code takes 54 seconds to generate 9 KB file.
When I use 7zip archiver, it takes less than a second and generates 9KB file.
I am hoping that there is a setting that I am missing to speed things up?
The text was updated successfully, but these errors were encountered:
No, it was debug mode, I tried it with release mode and its taking 4.2 seconds which is still less than %25 speed of the original archiver. Since I will be using it for very large text files (100MB+), I need a solution that is minimum %75 slower, preferably better than the original solution.
Hi,
I am using sevenz-rust version 0.4.3, with Rust 1.71 on Windows. I am using the code below:
`
use std::path::{Path, PathBuf};
use std::fs::{File,OpenOptions};
use sevenz_rust::lzma::{LZMA2Options ,LZMA2Reader,LZMA2Writer};
use sevenz_rust::{SevenZReader, SevenZWriter, Password, SevenZArchiveEntry};
use std::{process::exit};
use std::time::Instant;
fn main() {
let verb_duration=Instant::now();
let file_name="testdir\folder1\file3.txt";
let file_path=PathBuf::from(file_name);
}
`
file3.txt is a 50MB text file and above code takes 54 seconds to generate 9 KB file.
When I use 7zip archiver, it takes less than a second and generates 9KB file.
I am hoping that there is a setting that I am missing to speed things up?
The text was updated successfully, but these errors were encountered: