Sounds cool! Have you measured the performance difference between checking signature and not?

In my nostr swift lib I did a quick test and seems like verifying signature takes an extra 2 milliseconds. I guess this can add up, but if it’s all done on background thread it shouldn’t be that big of a deal. Or maybe I’m just being optimistic. 😅

Reply to this note

Please Login to reply.

Discussion

yeah, I've done a lot of tests; it's, by FAR, the most expensive part of any full client I write.

Wrong: the most expensive part is getting yarn to work.

2 milliseconds is already too much I think, that's already worse than pure JS. With Wasm things drop a lot, native C + Swift should be even faster.

verification so fast in nostrdb on multiple threads the perf hit is so small its no longer a concern. those poor js souls 🥲

The next step should be writing a browser engine in nostrdb so you can do everything in JS inside it.

you joke but i’m already hooking up my C wasm interpreter to talk to nostrdb so you can script access to the local relay 😆

Have you thought about generating predefined UI components from wasm scripts? Simple things like input boxes and buttons that then trigger some action which then outputs a table?, I don't know. What I have in mind are the simple UIs you can write programmatically for Telegram and Discord bots, for example. They are very limited and yet people can very easily write powerful apps (bots) in them.

Could be standardized between different clients and then the actual layout would be different everywhere but the functionality would be the same.

But maybe this gets too complex too quickly and it's not worth doing. Or the scripts would be huge? Not sure if that's a problem.

I have thought about these things but there are so many directions you can go with it. Just going to keep it simple right now: provide a simple way to query and provide the results to… something. Maybe a list. I dunno. Its more of an idea playground at the moment

Sounds a good idea.

Yeah my initial test was run just via swift test case which doesn’t do any optimizations. Working on an actual benchmark. Will post soon.

Are you telling me we will have a big repo with reproducible comparable benchmarks between all Nostr libraries and languages for all the basic Nostr tasks TOMORROW?

Ummmmm. Haha. No. But I will work towards building benchmarks for my swift nostr core lib.