PHP - *fast* serialize/unserialize?

前端 未结 8 1761
死守一世寂寞
死守一世寂寞 2021-02-19 04:54

I have a PHP script that builds a binary search tree over a rather large CSV file (5MB+). This is nice and all, but it takes about 3 seconds to read/parse/index the file.

<
相关标签:
8条回答
  • 2021-02-19 05:33

    SQLite comes with PHP, you could use that as your database. Otherwise you could try using sessions, then you don't have to serialize anything, you just saving the raw PHP object.

    0 讨论(0)
  • 2021-02-19 05:38

    Try igbinary...did wonders for me:

    http://pecl.php.net/package/igbinary

    0 讨论(0)
提交回复
热议问题