-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Experiment #2 to replace the large array of Excel function definitions with a FlyWeight Pattern collection of Value Objects #2734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MarkBaker
wants to merge
4
commits into
master
from
Experiment-Maintaining-Excel-Function-List-as-an-ArrayObject-2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...n signature definitions with a structured collection of Value Objects to see what affect it has on memory usage and speed. This isn't a perfect implementation yet: but it's enough to take a look at the memory usage and speed.
...ther than starting with a pre-populated list
- TEXTBEFORE – Returns text that’s before delimiting characters - TEXTAFTER – Returns text that’s after delimiting character - TEXTSPLIT – Splits text into rows or columns using delimiters - VSTACK – Stacks arrays vertically - HSTACK – Stacks arrays horizontally - TOROW – Returns the array as one row - TOCOL – Returns the array as one column - WRAPROWS – Wraps a row array into a 2D array - WRAPCOLS – Wraps a column array into a 2D array - TAKE – Returns rows or columns from array start or end - DROP – Drops rows or columns from array start or end - CHOOSEROWS – Returns the specified rows from an array - CHOOSECOLS – Returns the specified columns from an array - EXPAND – Expands an array to the specified dimensions
This was referenced Jun 18, 2022
oleibman
added a commit
to oleibman/PhpSpreadsheet
that referenced
this pull request
Mar 2, 2025
For an overview of why this is desired (and ways that people have coped with its absence), see issue PHPOffice#2900 and issue PHPOffice#4048; also PR PHPOffice#4043 which will be superseded by this PR. The list of Excel functions is moved from Calculation/Calculation to its own member. I believe that it is done in a way that will not cause big complications to two experiments from @MarkBaker (PR PHPOffice#2714 and PR PHPOffice#2734). I believe it is also done in such a way that further refactoring of Calculation can follow this model. Custom functions can be added or removed from the function list. You cannot add a function if it already exists in the list, and you cannot remove a non-custom function from the list. They will, of course, not be understood by Excel if written to a spreadsheet; the use case is mainly using the Calculation engine outside of spreadsheet context.
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is:
Checklist:
Why this change is needed?
Experiment to replace the large "unstructured" array of Excel function signature definitions with a structured collection of Value Objects to see what affect it has on memory usage and speed.
This isn't a perfect implementation yet: but it's enough to take a look at the memory usage and speed of the new solution.
Hopefully, this approach will also make Excel function definitions/implementations easier to maintain in future, and potentially allow new benefits such as defining the Excel version where they became available, and also if Microsoft have deprecated them.