PHP - *fast* serialize/unserialize?

前端 未结 8 1639
死守一世寂寞
死守一世寂寞 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条回答
  •  旧时难觅i
    2021-02-19 05:21

    What about using something like JSON for a format for storing/loading the data? I have no idea how fast the JSON parser is in PHP, but it's usually a fast operation in most languages and it's a lightweight format.

    http://php.net/manual/en/book.json.php

提交回复
热议问题