I learn the most by reading and playing with code. So after reading NIP01 i wanted to play with the tests nostr:npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6 wrote in the nostr-tools (TS) repo.

Ported some tests to Bun (v2) and saw a 2x speed in signing/verifying events (obviously all related to runtime improvements) (screenshot below)

No plans to continue writing these tests. What's the point of optimising a test suite that takes 7 seconds to run 280 tests outside of `deno fmt` (which is awesome). But i do wonder if the current relay implementations in Typescript (nostream, nostr-relay-nestjs) will have to deal with performance as Nostr gets more popular.

Reply to this note

Please Login to reply.

Discussion

I thought we were already using bun for the tests in nostr-tools, aren't we?

I didn't write most of those tests, by the way.

Fuck me. I meant Deno 😆. You are using Bun in TS side.

Your name came up because last touch on some of these tests were one of your commits

Fuck me 😁 Where i wrote Bun i meant to say Deno. You are using Bun in the test suite.

Tnx for clarifying. Your name came up in the commit because you last touched these files.

I regularly add a newline to the end of files then remove it later in order to make it look like there is activity in the repo and prevent people from dismissing it as unmantained.

You can easily automate this task with a little script, can't you?