Skip to content

Excessive readFilter->readCell() increase runtime notably when parsing XSLX files #772

@DennisBirkholz

Description

@DennisBirkholz

This is:

- [x] a bug report

What is the expected behavior?

Parsing with styles enabled or disabled should not have a considerable different parsing time.

What is the current behavior?

A rather large file with ~6000 rows and 10 columns takes about 2 seconds to parse with $reader->setReadDataOnly(false) but takes about 30 seconds with $reader->setReadDataOnly(true).

What are the steps to reproduce?

<?php

require __DIR__ . '/vendor/autoload.php';

// Takes 30 seconds
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile('large_spreadsheet.xlsx');
$document = $reader->load('large_spreadsheet.xlsx');

// Takes 2 seconds
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile('large_spreadsheet.xlsx');
$reader->setReadDataOnly(true);
$document = $reader->load('large_spreadsheet.xlsx');

Which versions of PhpSpreadsheet and PHP are affected?

PHP 5.6 and PHPSpreadsheet 1.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions