Thread overview
Photon v0.12.1 with 50% faster eventloop
Jul 31
IchorDev
4 days ago
IchorDev
July 28

So big news is that on Linux (and soon on other platforms) eventloop was rewritten to run faster especially in chatty apps that do lots of smallish send/recv ping pong. The end result is 50% faster end-to-end memcached benchmark for my up and coming hedgehog[1] server. It's now actually 15-20% faster than stock memcached on memtier benchmark and about 50% faster on memcslap tests I carried out, this is far from extensive benchmarking and hedgehog is not even that optimized yet(!)

Of other notable additions is support for AArach64 on Linux. I basically spun up virtual machine on my Mac and to my dismay AArch64 was not supported yet so I fixed it making the code more portable going forward.

All in all I find that fibers can deliver as long as we are not going into millions of connections.

  1. https://github.com/DmitryOlshansky/hedgehog

--
Dmitry Olshansky
CEO @ Glowlabs
https://olshansky.me

July 28

On Monday, 28 July 2025 at 19:57:41 UTC, Dmitry Olshansky wrote:

>

So big news is that on Linux (and soon on other platforms) eventloop was rewritten to run faster especially in chatty apps that do lots of smallish send/recv ping pong. The end result is 50% faster end-to-end memcached benchmark for my up and coming hedgehog[1] server. It's now actually 15-20% faster than stock memcached on memtier benchmark and about 50% faster on memcslap tests I carried out, this is far from extensive benchmarking and hedgehog is not even that optimized yet(!)

[...]

And ofc I forgot the obligatory link:

https://github.com/DmitryOlshansky/photon

July 31

On Monday, 28 July 2025 at 19:57:41 UTC, Dmitry Olshansky wrote:

>

So big news is that on Linux (and soon on other platforms) eventloop was rewritten to run faster especially in chatty apps that do lots of smallish send/recv ping pong. The end result is 50% faster end-to-end memcached benchmark for my up and coming hedgehog[1] server. It's now actually 15-20% faster than stock memcached on memtier benchmark and about 50% faster on memcslap tests I carried out, this is far from extensive benchmarking and hedgehog is not even that optimized yet(!)

Of other notable additions is support for AArach64 on Linux. I basically spun up virtual machine on my Mac and to my dismay AArch64 was not supported yet so I fixed it making the code more portable going forward.

All in all I find that fibers can deliver as long as we are not going into millions of connections.

Well done! Are there any plans to integrate this project into vibe.d's eventcore?

August 01

On Thursday, 31 July 2025 at 12:48:18 UTC, IchorDev wrote:

>

On Monday, 28 July 2025 at 19:57:41 UTC, Dmitry Olshansky wrote:

>

All in all I find that fibers can deliver as long as we are not going into millions of connections.

Well done! Are there any plans to integrate this project into vibe.d's eventcore?

Eventcore is too low-level interface to meaningfully improve upon. I’m cautiously optimistic about vibe.d core fork working on top of photon. It would then integrate with the rest of the vibe.d. To be honest it seems like vibe.d core is too high level, while eventcore is too low level, photon is somewhere in between.


Dmitry Olshansky
CEO @ Glowlabs
https://olshansky.me

August 02

On Monday, 28 July 2025 at 20:02:41 UTC, Dmitry Olshansky wrote:

>

And ofc I forgot the obligatory link:

https://github.com/DmitryOlshansky/photon

Undoubtedly, Photon is a good piece of software, because the passing years have taught us a lot. Especially when you mentioned its nature, you said that Photon’s nature is dual. I sense that you have an interest in physics, and therefore in science, and I feel the names were not chosen by coincidence.

We (my colleagues and I) use loops in electronics as well. After all, isn’t life itself a loop? I’d like to benefit from Photon for microcontrollers too. Let me give an example: when branching from the main loop to a subroutine—which can even be another microcontroller on a separate PCB—you momentarily step away from other tasks, forced by me to do so. In a way, when one microcontroller sleeps, the other wakes up and practically takes over the operations. It strongly resembles a relay race. You also seem to be doing things similar to what we do in electronics. After all, threads are almost like independent circuits.

Wishing you success...

SDB@79

August 02

On Saturday, 2 August 2025 at 05:27:04 UTC, Salih Dincer wrote:

>

On Monday, 28 July 2025 at 20:02:41 UTC, Dmitry Olshansky wrote:

>

And ofc I forgot the obligatory link:

https://github.com/DmitryOlshansky/photon

Undoubtedly, Photon is a good piece of software, because the passing years have taught us a lot. Especially when you mentioned its nature, you said that Photon’s nature is dual. I sense that you have an interest in physics, and therefore in science, and I feel the names were not chosen by coincidence.

I have BSc in applied math and physics. Indeed the name was chosen very specifically. Unfortunately Ali Baba written their own fiber scheduling runtime called photon. I’m not sure if I was the first but ofc now living in the shadow of the big tech.

>

We (my colleagues and I) use loops in electronics as well. After all, isn’t life itself a loop? I’d like to benefit from Photon for microcontrollers too. Let me give an example: when branching from the main loop to a subroutine—which can even be another microcontroller on a separate PCB—you momentarily step away from other tasks, forced by me to do so. In a way, when one microcontroller sleeps, the other wakes up and practically takes over the operations. It strongly resembles a relay race. You also seem to be doing things similar to what we do in electronics. After all, threads are almost like independent circuits.

Cooperative multitasking could be indeed spread across a fleet of MCUs, it is tricky but could provide the benefit of simple mental model while programming such a board.

>

Wishing you success...

There is a lot to tackle still.

>

SDB@79

4 days ago

On Friday, 1 August 2025 at 08:35:49 UTC, Dmitry Olshansky wrote:

>

On Thursday, 31 July 2025 at 12:48:18 UTC, IchorDev wrote:

>

Well done! Are there any plans to integrate this project into vibe.d's eventcore?

Eventcore is too low-level interface to meaningfully improve upon. I’m cautiously optimistic about vibe.d core fork working on top of photon. It would then integrate with the rest of the vibe.d. To be honest it seems like vibe.d core is too high level, while eventcore is too low level, photon is somewhere in between.

Well, good luck then!