D
Deno

help

Trying to benchmark `Deno.remove` but it fails

Bbabakfp11/16/2023
deno bench --allow-write bench.ts
Check file:///C:/Users/babak/OneDrive/Desktop/deno-benchmark-345654/bench.ts
cpu: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
runtime: deno 1.36.4 (x86_64-pc-windows-msvc)

file:///C:/Users/babak/OneDrive/Desktop/deno-benchmark-345654/bench.ts
Deno.remove error: NotFound: The system cannot find the file specified. (os error 2): remove './assets'
await Deno.remove("./assets", { recursive: true })
^
at async Object.remove (ext:deno_fs/30_fs.js:201:3)
at async file:///C:/Users/babak/OneDrive/Desktop/deno-benchmark-345654/bench.ts:2:5
error: Bench failed
deno bench --allow-write bench.ts
Check file:///C:/Users/babak/OneDrive/Desktop/deno-benchmark-345654/bench.ts
cpu: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
runtime: deno 1.36.4 (x86_64-pc-windows-msvc)

file:///C:/Users/babak/OneDrive/Desktop/deno-benchmark-345654/bench.ts
Deno.remove error: NotFound: The system cannot find the file specified. (os error 2): remove './assets'
await Deno.remove("./assets", { recursive: true })
^
at async Object.remove (ext:deno_fs/30_fs.js:201:3)
at async file:///C:/Users/babak/OneDrive/Desktop/deno-benchmark-345654/bench.ts:2:5
error: Bench failed
IioB11/16/2023
The benchmark runs the code several times In this case, it ran it once, deleted the folder, and ran it again and found no folder to delete You need to re-add the folder every time
Bbabakfp11/16/2023
Aha Thanks for that. Is there a way to tell it to run only once?
ABAltair 680b11/16/2023
just use performance.now() for single test
IioB11/16/2023
you cannot get an accurate benchmark off of one deletion, so no, but you can do what @BuenoFan suggested
ABAltair 680b11/16/2023
const start = performance.now();
// do something
const took = performance.now() - start;
const start = performance.now();
// do something
const took = performance.now() - start;
Bbabakfp11/16/2023
Alright, thanks guys 🌸🌸

Looking for more? Join the community!

Recommended Posts
Plot Vega-Lite in Jupyter Notebook running the Deno kernelHello, I am very new to Deno... I wanted to see if I can produce some interactive Vega visualizaitonSegfault when creating second rust MainWorker in programHello. Not sure if this is the place to ask since it seems to be a v8 issue (or perhaps an issue wiHow can I use "Logging with colors" with `"npm:log-update"`Hi https://examples.deno.land/color-logging I don't want to use Chalk because it's not properly typeHow to uploading images from frontend to Deno.serve()Hey, can someone please give me a vanilla code example on how to upload files from my frontend applDeno Deploy JSON importI'm using zod-i18n-map library for error translation, which requires an import for the library itselMost efficient way to broadcast messages globally across main script and workers?I basically want a simple message bus that is global to all my workers + the main script, without reWhat is the process for deploying a jupyter notebook made using deno?I have webdev experience and was using Observable. I was looking for alternatives that use javascripPostGraphile on DenoDoes PostGraphile work with Deno? Trying to see if I can run PostGraphile as a serverless function oIs there any way to disable Deno's Intellisense feature without disabling Deno itself?When programming with Deno, I've noticed how relatively slow the lang server is, and I need intellisDeploying Lume to github pagesI'm totaly new to this, but have been following instructions to build a site with lume. It works locBest hardware for Deno development?I am looking for a new laptop / desktop for Deno development as my current setup seems no longer viaHow do I make the crypto.subtle.digest algo flexible?This is a learning moment, bear with me. 😅 I can hard code an algo for the digest like this: ```twhat’s the current best practice for bundling?Is it deno esbuild? Wondering what supports npm specifiers and bundling atmHow do I get a d.ts file to be used?I'm extending a type from `hono` by adding that code in a `hono.d.ts` file in my `src` folder. ```“Log streaming API” on Deno DeployWhat does “Log streaming API” refers to in the analytics section of the pricing page of Deno Deploy?Read-only FS detectionHi, I have few deps that by default create cache/log dirs... I can disable it, but the detection itsIs there a built-in parser for the string that Deno.inspect produces?I found out in another thread that Deno.inspect(myObj) produces a visually gorgeous string representHow to get the nice Deno console.log format into a string?When I do a console.log on an instantiated class object, I get a beautiful format in the terminal, t