typescript-runtime-type-benchmarks icon indicating copy to clipboard operation
typescript-runtime-type-benchmarks copied to clipboard

[Enhancement] add Deno runtime in benchmark

Open scarf005 opened this issue 1 year ago • 13 comments

adding Deno runtime to benchmark would be useful, especially since Deno runs typescript as first class citizen.

i'm interested in opening a PR if it's acceptable. (I'd be grateful for pointers on where to work)

scarf005 avatar Jun 11 '24 08:06 scarf005

https://github.com/moltar/typescript-runtime-type-benchmarks/pull/1225

Now Bun runtime added so Deno will be accepted i guess

Not fan of Deno but for better runtimes comparison it would be useful!

kravetsone avatar Sep 14 '24 11:09 kravetsone

Not fan of Deno

could you elaborate?

scarf005 avatar Sep 14 '24 13:09 scarf005

I have started to work on deno support here https://github.com/DarkGL/typescript-runtime-type-benchmarks/pull/4

Never worked with deno, so I have some problems to get it working, do you want to progress with it, or you can help me integrating it ?

DarkGL avatar Sep 14 '24 14:09 DarkGL

Never worked with deno, so I have some problems to get it working, do you want to progress with it, or you can help me integrating it ?

@DarkGL tinkering with it right now. you can see it in https://github.com/scarf005/typescript-runtime-type-benchmarks (it's a mess) Some thoughts:

  • in order to add deno, code structure may need to have wildly changed.
  • in particular, start.sh, index.ts and benchmarks/main.ts may need to be changed a lot due to Deno lacking process and lacking node specific features.
  • could you share issues you encountered?
  • is CJS mandatory in running benchmarks? i could make Deno with ESM, not sure if it's possible with CJS
  • some imports had to be replaced with esm.sh imports due to some of the modules having malformed ESM support

scarf005 avatar Sep 14 '24 16:09 scarf005

I had a problem running deno test inside pr.yml, but I can already see after looking at your branch that there will be many more problems to resolve

DarkGL avatar Sep 14 '24 16:09 DarkGL

I'll try to work on it tomorrow, planning to generate package.json to esm.sh mapping so imports are properly resolved to ESM.

scarf005 avatar Sep 14 '24 16:09 scarf005

Never worked with deno, so I have some problems to get it working, do you want to progress with it, or you can help me integrating it ?

@DarkGL tinkering with it right now. you can see it in https://github.com/scarf005/typescript-runtime-type-benchmarks (it's a mess) Some thoughts:

  • in order to add deno, code structure may need to have wildly changed.
  • in particular, start.sh, index.ts and benchmarks/main.ts may need to be changed a lot due to Deno lacking process and lacking node specific features.
  • could you share issues you encountered?
  • is CJS mandatory in running benchmarks? i could make Deno with ESM, not sure if it's possible with CJS
  • some imports had to be replaced with esm.sh imports due to some of the modules having malformed ESM support

Deno moment

kravetsone avatar Sep 14 '24 17:09 kravetsone

Btw. I think CJS was used because packages lacked support for ESM, would be nice to know which one needs CJS currently and check if they shipped new version with ESM support

DarkGL avatar Sep 14 '24 17:09 DarkGL

Deno moment

more of Node still not following browser standard moment :)

scarf005 avatar Sep 14 '24 23:09 scarf005

Not fan of Deno

could you elaborate?

nobody is interested in a Deno that will slowly die

also, with the 2.0 version, they will deceive many of their fans (they will remove the features of Deno)

Bun is more fine to me

It solve many problems and more faster than Deno

after many years in Deno, undici does not work on Windows...

I like that Bun is committed to drop-in replacement

It will be seen now) that a lot of changes will need to be made to support Deno

kravetsone avatar Sep 15 '24 08:09 kravetsone

This shouldn't be a thread where we talk about deno vs bun or deno vs node.

Let's focus on integrating it.

DarkGL avatar Sep 15 '24 14:09 DarkGL

@scarf005 with upcoming version 2 of deno do you think it will be easier to integrate?

DarkGL avatar Sep 22 '24 09:09 DarkGL

@scarf005 with upcoming version 2 of deno do you think it will be easier to integrate?

It should be much easier because Deno abandoned his ideas

kravetsone avatar Sep 22 '24 13:09 kravetsone

@scarf005 @kravetsone would you be willing to work on this together (with me)?

I want to progress with it, so we have node + bun + deno

DarkGL avatar Nov 14 '24 17:11 DarkGL

What are the hurdles currently on getting the benchmarks to run with Deno?

thoroc avatar Jan 31 '25 06:01 thoroc

I think the biggest progress was done here, https://github.com/scarf005/typescript-runtime-type-benchmarks

But I don't know what problems @scarf005 encountered

DarkGL avatar Jan 31 '25 07:01 DarkGL

iirc there were issues in deno's node:child_process polyfill, will check again on deno 2

scarf005 avatar Jan 31 '25 08:01 scarf005