Mario Zechner on Nostr: I have a bunch of services that need to communicate with each other. Here's a NodeJS ...
I have a bunch of services that need to communicate with each other. Here's a NodeJS based service trying to a C++ based service.
Using Node's built-in fetch(), I get 3 req/sec.
Using Node's http.request(), I get 8100 req/sec.
Not a typo. Can anyone explain what's going on? I understand that fetch() will have some overhead due to being largely compatible with the browser fetch. But this is too much.
Published at
2024-12-04 02:22:40 UTCEvent JSON
{
"id": "e0d193ecca4627a5fdff6ff58b63256612dff86fbde863a5feeadd7f1fa92c0f",
"pubkey": "f2599622ae7eacde4a8f175ea5aa23581d75a336cabbaceb96c410aa50c80ec4",
"created_at": 1733278960,
"kind": 1,
"tags": [
[
"imeta",
"url https://cdn.masto.host/mastodongamedevplace/media_attachments/files/113/592/160/285/704/020/original/a34802ec7c0ff6c6.png",
"m image/png"
],
[
"proxy",
"https://mastodon.gamedev.place/@badlogic/113592169940206329",
"web"
],
[
"imeta",
"url https://cdn.masto.host/mastodongamedevplace/media_attachments/files/113/592/163/752/151/729/original/7d338ec7136670dc.png",
"m image/png"
],
[
"proxy",
"https://mastodon.gamedev.place/users/badlogic/statuses/113592169940206329",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.gamedev.place/users/badlogic/statuses/113592169940206329",
"pink.momostr"
],
[
"-"
]
],
"content": "I have a bunch of services that need to communicate with each other. Here's a NodeJS based service trying to a C++ based service.\n\nUsing Node's built-in fetch(), I get 3 req/sec.\n\nUsing Node's http.request(), I get 8100 req/sec.\n\nNot a typo. Can anyone explain what's going on? I understand that fetch() will have some overhead due to being largely compatible with the browser fetch. But this is too much.\nhttps://cdn.masto.host/mastodongamedevplace/media_attachments/files/113/592/160/285/704/020/original/a34802ec7c0ff6c6.png\nhttps://cdn.masto.host/mastodongamedevplace/media_attachments/files/113/592/163/752/151/729/original/7d338ec7136670dc.png\n",
"sig": "8a994710c661d8aea43da5ec38639478bb6f350dd8355663aeb037c1bd51181675840fffd2519c79ecc8f7f9dcbe60d5c1494bdd160aecc647ffd8e47335a682"
}