Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1087327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:55:25+00:00 2026-05-16T22:55:25+00:00

am exporting huge data to excel using php. i change that to csv and

  • 0

am exporting huge data to excel using php.

i change that to csv and text.

i see no difference in file size.

So PHP performance have anything to do with file format.

even if file format is different , rows and columns is same.
consider 60 column and 100000 rows.

is there any optimizing technique,other than ini memory limit and execution time.
we have to taken care

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:55:26+00:00Added an answer on May 16, 2026 at 10:55 pm

    As far as I know, the various Excel libraries for PHP will build the spreadsheet in-memory, which could cause problems for very large data sets. CSV/txt, on the other hand, can be written out to disk or the client for each row, so memory usage is minimal.

    Performance-wise, the Excel libraries will always have larger overhead. There’s all kinds of extra Excel-specific binary bits in the file which need special handling in PHP, whereas CSV is just plain text. PHP’s core purpose is to be able to spit out large amounts of text very quickly, so generating csv/txt is going to be faster, always. And of course, there’s function call over head. In pseudo code, consider the difference between:

    CSV:

    echo "$column1, $column2, $column3, $column4";
    

    versus Excel:

    $workbook->write('A1', $column1);
    $workbook->write('B1', $column2);
    $workbook->write('C1', $column3);
    $workbook->write('D1', $column3);
    
    etc...
    

    On the plus side for Excel, particularly with XLSX, there is some compression so the same amount of data will take up less space. This can be mitigated somewhat by using compression in the webserver, or feeding the CSV/txt output into a Zip library server-side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When exporting a lot of data to a string (csv format), I get a
Am exporting data to csv. after 25000 records , memory exhausted. Memory limit increasing
I am exporting a gridview to excel, using .Net 4.0 in a web application,
I am working on exporting a data.frame to a csv for use in an
I'm exporting a CSV to firefox using the following code: string csv = dataTable.ToCSV();
I need to create a test database out of a huge database where the
I have huge object, I have its class of course, I'm extracting some values
I am exporting from one table and importing to another table. First i import
I'm exporting a grid with NPOI v1.2.3, and am having trouble getting cell formatting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.