Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
Deno Slow FS Performance

I've noticed a very noticeably slow performance in reading files in deno, I'm afraid I might be doing it wrong. (kinda stupid?)

const file = Deno.readFileSync(path)

any suggestions? or other faster ways? should I use Deno.run instead? what are the pros and cons of Deno.run in your experience?

Update #1:

I found this module using streams in which it give some more speed, but compared to bash it's very slow:

$ time deno run --allow-read https://deno.land/std@0.126.0/examples/cat.ts movie.mp4 |  wc -l
4066379

real    0m1.890s
user    0m1.608s
sys     0m1.355s

$ time cat movie.mp4 | wc -l
4066379

real    0m0.295s
user    0m0.098s
sys     0m0.372s

$ du -sh movie.mp4 
995M    movie.mp4

Update #2:

Due to the worries of the network speed and Deno launch speed, I made this script where it has them both running respectively:

import {
  copy,
  writeAllSync,
} from "https://deno.land/std@0.126.0/streams/conversion.ts";

const filenames = "movie.mp4";

//########## DENO ############

const before1 = performance.now();

const file = await Deno.open(filenames);
await copy(file, Deno.stdout);
file.close();

const after1 = performance.now() - before1;

const text1 = new TextEncoder().encode(after1.toString() + "\n");
writeAllSync(Deno.stderr, text1);

//########## CMD ############

const before2 = performance.now();

const p = Deno.run({
  cmd: ["cat", `${filenames}`],
});

await p.status()

const after2 = performance.now() - before2;

const text2 = new TextEncoder().encode(after2.toString() + "\n");
writeAllSync(Deno.stderr, text2);

Results in best case:

$ deno run --allow-run --allow-read test.ts >/dev/null
636
82
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Until this moment of writing this comment, I'd like to mention there are no solutions regarding this well-known issue in deno.

There are multiple opened issues in denoland/deno Repository. If there are any updates, I will post an update.

To mention few:

#13720

#10157

#803

#246

#13608

If you find any, please let me know.

Thanks.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!