0

My rust app needs to have access to world heightmap data (topography) which I have downloaded from nasa's official website. Currently, with me using the Image crate https://lib.rs/crates/image, it takes roughly 1 minute for the entire app to load, which is completely unacceptable. Is there any rust crate that is specifically designed to load images that large? I do not want to compress the file aswell, as that might possible mess up the height data.

Herohtar
  • 5,347
  • 4
  • 31
  • 41
James Gaunt
  • 119
  • 1
  • 14
  • Compile in release mode (aka `cargo build/run --release`). I have an 83MB .png locally that loads in about a minute in debug mode with the `image` crate but within a *second* in release mode. – kmdreko Aug 28 '22 at 03:21
  • Thanks, I don't have any idea why, but it loaded in about a second when I run it in release mode. It will make it hard for me to debug unfortunately, but I see I don't have much of a choice. – James Gaunt Aug 28 '22 at 03:26
  • Perhaps you can specify `opt-level=3` only for the `image` crate. – Chayim Friedman Aug 28 '22 at 03:27
  • https://stackoverflow.com/questions/60751806/how-to-compile-some-dependencies-with-release – kmdreko Aug 28 '22 at 03:28
  • Oh thanks, I forgot about that feature in rust. I have used bevy before so I should have thought of that. – James Gaunt Aug 28 '22 at 03:28
  • 1
    *"I do not want to compress"* I hope you are talking about lossy compression, because there are good lossless compression formats, like png. – Finomnis Aug 28 '22 at 07:10

1 Answers1

-1

I ran the application in release mode and everything works fine now.

James Gaunt
  • 119
  • 1
  • 14