Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

String concat performance improve #25

Merged
merged 1 commit into from
Jul 12, 2020
Merged

String concat performance improve #25

merged 1 commit into from
Jul 12, 2020

Conversation

stdex
Copy link
Contributor

@stdex stdex commented Jul 11, 2020

Based on issue:
https://pear.php.net/bugs/bug.php?id=18866

Fix performance string concat

php 7.4, write xls by 5 cell in each row

rows :: seconds

[now]
10000 :: 0.4
20000 :: 1.1
30000 :: 2.1
40000 :: 9.9
50000 :: 25.0
65534 :: 46.6

[after fix]
10000 :: 0.2
20000 :: 0.4
30000 :: 0.6
40000 :: 0.8
50000 :: 1.0
65534 :: 1.4

Fix concat string
@sanmai
Copy link
Member

sanmai commented Jul 12, 2020

Thank you.

@sanmai sanmai merged commit a386acb into pear:master Jul 12, 2020
@sanmai
Copy link
Member

sanmai commented Jul 13, 2020

Would you mind sharing the benchmark you used?

@stdex
Copy link
Contributor Author

stdex commented Jul 16, 2020

Would you mind sharing the benchmark you used?

Yes. I share benchmark here: https://github.com/stdex/xls-benchmarks
Some results available in Travis CI build: https://travis-ci.com/github/stdex/xls-benchmarks/builds/175971157

You also may notice me, that the results are slightly different from the ones I presented initially in this MR.

Travis:
------------------------------------------------------------------------------------------------------------
| Package                       | Version    | Test       | Avg Duration (MS) | Avg Peak memory usage (MB) |
------------------------------------------------------------------------------------------------------------
| pear/spreadsheet_excel_writer | dev-master | writerTest | 7937              | 19                         |
------------------------------------------------------------------------------------------------------------

Local:
------------------------------------------------------------------------------------------------------------
| Package                       | Version    | Test       | Avg Duration (MS) | Avg Peak memory usage (MB) |
------------------------------------------------------------------------------------------------------------
| pear/spreadsheet_excel_writer | dev-master | writerTest | 1424.62           | 16                         |
------------------------------------------------------------------------------------------------------------

Those the absolute results are highly dependent on the platform the script is run on.

@stdex stdex deleted the pref_improve_concata branch July 16, 2020 22:41
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants