POST https://kbin.spritesserver.nl/f/inbox

Messages

Ordered list of dispatched messages across all your buses

"App\Message\ActivityPub\Inbox\ActivityMessage"
Caller In SharedInboxController.php line
Bus messenger.bus.default
Message
App\Message\ActivityPub\Inbox\ActivityMessage {#353
  +payload: "{"@context":["https://join-lemmy.org/context.json","https://www.w3.org/ns/activitystreams"],"actor":"https://programming.dev/c/programmer_humor","to":["https://www.w3.org/ns/activitystreams#Public"],"object":{"id":"https://lemmy.world/activities/create/6fc5a7d5-57ba-48e9-9eae-47feff45653e","actor":"https://lemmy.world/u/Buddahriffic","@context":["https://join-lemmy.org/context.json","https://www.w3.org/ns/activitystreams"],"to":["https://www.w3.org/ns/activitystreams#Public"],"object":{"type":"Note","id":"https://lemmy.world/comment/20322173","attributedTo":"https://lemmy.world/u/Buddahriffic","to":["https://www.w3.org/ns/activitystreams#Public"],"cc":["https://programming.dev/c/programmer_humor","https://lemmy.world/u/kender242"],"content":"<p>That assumes SetTimeout() is O(1), but I suspect it is O(log(n)), making the algorithm O(n*log(n)), just like any other sort.</p>\n<p>Did some looking into the specifics of SetTimeout() and while it uses a data structure with theoretical O(1) insertion, deletion, and execution (called a time wheel if you want to look it up), the actual complexity for deletion and execution is O(n/m) (if values get well distributed across the buckets, just O(n) if not) where m is the number of buckets used. For a lot of use cases you do get an effective O(1) for each step, but I don’t believe using it as a sorting engine would get the best case performance out of it. So in terms of just n (considering m is usually constant), it’ll be more like O(n²).</p>\n<p>And it’s actually a bit worse than that because the algorithm isn’t just O(n/m) on execution. It needs to check each element of one bucket every tick of whatever bucket resolution it is using. So it’s actually non-trivially dependent on the wait time of the longest value. It’s still a constant multiplier so the big O notation still says O(n) (just for the check on all ticks), but it might be one of the most misleading O(n)'s I’ve ever seen.</p>\n<p>Other timer implementations can do better for execute and delete, but then you lose that O(1) insertion and end up back at O(n*log(n)), but one that scales worse than tree sort because it is literally tree sort plus waiting for timeouts.</p>\n<p>Oh and now, reading your comment again after reading about SetTimeout(), I see I misunderstood when I first read it and thought you meant it was almost as fast as bucket sort, but see now you meant it basically is bucket sort because of that SetTimeout() implementation. Bucket sort best case is O(n), worst case is O(n²), so I guess I can still do decent analysis lol.</p>\n","inReplyTo":"https://lemmy.world/comment/20305209","mediaType":"text/html","source":{"content":"That assumes SetTimeout() is O(1), but I suspect it is O(log(n)), making the algorithm O(n*log(n)), just like any other sort.\n\nDid some looking into the specifics of SetTimeout() and while it uses a data structure with theoretical O(1) insertion, deletion, and execution (called a time wheel if you want to look it up), the actual complexity for deletion and execution is O(n/m) (if values get well distributed across the buckets, just O(n) if not) where m is the number of buckets used. For a lot of use cases you do get an effective O(1) for each step, but I don't believe using it as a sorting engine would get the best case performance out of it. So in terms of just n (considering m is usually constant), it'll be more like O(n²).\n\nAnd it's actually a bit worse than that because the algorithm isn't just O(n/m) on execution. It needs to check each element of one bucket every tick of whatever bucket resolution it is using. So it's actually non-trivially dependent on the wait time of the longest value. It's still a constant multiplier so the big O notation still says O(n) (just for the check on all ticks), but it might be one of the most misleading O(n)'s I've ever seen.\n\nOther timer implementations can do better for execute and delete, but then you lose that O(1) insertion and end up back at O(n*log(n)), but one that scales worse than tree sort because it is literally tree sort plus waiting for timeouts.\n\nOh and now, reading your comment again after reading about SetTimeout(), I see I misunderstood when I first read it and thought you meant it was almost as fast as bucket sort, but see now you meant it basically is bucket sort because of that SetTimeout() implementation. Bucket sort best case is O(n), worst case is O(n²), so I guess I can still do decent analysis lol.","mediaType":"text/markdown"},"published":"2025-11-05T05:26:32.691355Z","tag":[{"href":"https://lemmy.world/u/kender242","name":"@kender242@lemmy.world","type":"Mention"}],"distinguished":false,"audience":"https://programming.dev/c/programmer_humor","attachment":[]},"cc":["https://programming.dev/c/programmer_humor","https://lemmy.world/u/kender242"],"tag":[{"href":"https://lemmy.world/u/kender242","name":"@kender242@lemmy.world","type":"Mention"}],"type":"Create","audience":"https://programming.dev/c/programmer_humor"},"cc":["https://programming.dev/c/programmer_humor/followers"],"type":"Announce","id":"https://programming.dev/activities/announce/create/bbbc9f6b-4795-4875-880a-da747ff984d7"}"
  +request: [
    "host" => "kbin.spritesserver.nl"
    "method" => "POST"
    "uri" => "/f/inbox"
    "client_ip" => "162.55.240.75"
  ]
  +headers: [
    "content-type" => [
      "application/activity+json"
    ]
    "host" => [
      "kbin.spritesserver.nl"
    ]
    "date" => [
      "Wed, 05 Nov 2025 05:27:13 GMT"
    ]
    "digest" => [
      "SHA-256=NUAOgDMtiis7NLY2s+9+9QYUuBDFxUqYpPxB0FPoL5o="
    ]
    "signature" => [
      "keyId="https://programming.dev/c/programmer_humor#main-key",algorithm="hs2019",headers="(request-target) content-type date digest host",signature="HbDsNpxsuueE8EciB7MOePd2zAWEcz2heXm8dxJOCZGyVI06X3qeyxpt+Cd1wnq33sKh5q/sXo2r8WDJDy4J/pu+g2+pcisy8qPcpsIGYwHfA4/d7bUbpOSMMDPi5vRneYqt6/Wjqy+mhtMmjYNoW7v6ATFMyPFNAgpCQw05h5GdrxhAJt8E52YpaCfr/ycSYxsMTOU0g6Dc1KLNPR5sc77yFU7jOseznCchZGLwDoNqDgrnuPPlGDtiSc5oxAoH5Lyebd1rOxYJ0yQoelFSB0n7oKRdP6JtIL3igxhwjUymYbJNnZ9q+IBCz+m4L9UeXdcrucgmDZnJdnu5Hw1Inw==""
    ]
    "accept" => [
      "*/*"
    ]
    "user-agent" => [
      "Lemmy/0.19.13; +https://programming.dev"
    ]
    "accept-encoding" => [
      "gzip"
    ]
    "content-length" => [
      "5197"
    ]
    "x-php-ob-level" => [
      "1"
    ]
  ]
}
Envelope stamps when dispatching No items
Envelope stamps after dispatch
Symfony\Component\Messenger\Stamp\BusNameStamp {#343
  -busName: "messenger.bus.default"
}
Symfony\Component\Messenger\Stamp\SentStamp {#268
  -senderClass: "Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineTransport"
  -senderAlias: "async_ap"
}
Symfony\Component\Messenger\Stamp\TransportMessageIdStamp {#227
  -id: "68889834"
}