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:40Event JSON
{
"id": "9eb0660180bf4b969d8344b8a810c57ac08e4c592b2298613c33da45c1917e94",
"pubkey": "be81b496ea025894275a88346ffbf7d217a8886f108185e401387647eff089b4",
"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",
"dim 1310x566",
"blurhash U04LUY?wW=Mx_3tlR+V?NGofxbxvNZ-o%MW?"
],
[
"imeta",
"url https://cdn.masto.host/mastodongamedevplace/media_attachments/files/113/592/163/752/151/729/original/7d338ec7136670dc.png",
"m image/png",
"dim 908x968",
"blurhash U04U{G.94nDi_3o#IUV?xBtRx^jF%Lt7oga#"
],
[
"proxy",
"https://mastodon.gamedev.place/users/badlogic/statuses/113592169940206329",
"activitypub"
]
],
"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.\n\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",
"sig": "bd8f73cf214fbe60fa91a0e047e144b5548491cd60fa6e97d053af4c56d71fd79b28779d8a1c736e75293c95ee1c1f132b54e7f9a77a6aabf150f4845903f504"
}