Why is shmop in PHP so slow

Viewed 92

It's been a while since I'm using PHP shmop extension(Shared Memory extension that allows direct R/W on RAM)

The problem I'm facing with shmop is it's extremely slow performance when Opening RAM Blocks of bigger size

By my benchmarks with shmop_open :

It takes < 1ms to open a memory block < 1KB
It takes ~1ms to open a 10KB Block
It takes ~8ms to open a 50KB Block

Why is it so slow ? RAMs are SuperFast devices to work with, why shmop takes just so long time ? Are there any faster alternatives to store some data in RAM in PHP to access later ?

I'm not looking for OPCode Caching, I wan't to store some frequently used JSON datas in RAM instead of a permanent database R/W, so I used shmop

0 Answers
Related