PHP read JSON file performance issues

Source: Internet
Author: User
Tags php write
PHP write a very simple interface, with a JSON file to do a simple database, with the increase in data, will there be performance problems? Do you have performance issues with multiple meetings? The size of the JSON file is expected to grow slowly and should not exceed 5M in 1 years

Reply content:

PHP write a very simple interface, with a JSON file to do a simple database, with the increase in data, will there be performance problems? Do you have performance issues with multiple meetings? The size of the JSON file is expected to grow slowly and should not exceed 5M in 1 years

Tell me about my previous measurements: The 18.2M JSON contains 3 W arrays of entries for each array 60 or so, deserialized and then serialized, processing time of about 1 seconds or so

Also say: This kind of interface actual bottleneck will appear on the server's bandwidth, similar interface requests are more likely to block the network.
But in terms of your current volume, there will be no short-term problems.

Using a few grams of JSON, parsing time will have to wait a long time, a few 10 seconds. Not exactly measured.

5m The amount of data is not much, the design should not be a problem.

The JSON for dozens of M is second-level. No need to worry about performance issues. As long as your JSON specification is compact.

The problem is not big.
If you are really worried, then you'd better normalize your JSON file format and use Fseek+fread 1.1 to read.

I use the serialize and unserialize to do, JSON, you 1 years not over 5M, the volume should not be very large.

It's only 5M, it's duly completed. Using caching wisely can also improve efficiency.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.