#Slow file reads for large files.

8 messages · Page 1 of 1 (latest)

exotic wigeon
#

I'm read a large-ish (100mb+) text files to use on the frontend but I'm getting very slow read speeds. 130mb is taking over 15 seconds. After reading the file I need to do some very light operations on it.
Since I'm a rust newbie I was hoping to do the latter part it in JS for now.

Standard readTextFile as well as this super simple rust command are performing almost the same.

#[tauri::command]
fn get_file_content(file_path: &str) -> String {
   let content = fs::read_to_string(path).expect("ERROR");
    content
}```

Any tips on getting this data to frontend faster?
pine geode
#

Ipc data transfer is slow due to the message passing serialisation/deserialization overhead of the rust /webview runtime

#

Maybe time to learn a bit of rust?

hazy arch
#

Also, always try debug vs release modes, there should be huge diffs - though still fairly slow for >100mb

exotic wigeon
signal jolt
#

@exotic wigeon what about strreaming ?

#

like return chunks by chunks