Skip to content
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

Performance issue in -setMinMaxDate #1340

Open
mrylmz opened this issue Oct 6, 2021 · 3 comments
Open

Performance issue in -setMinMaxDate #1340

mrylmz opened this issue Oct 6, 2021 · 3 comments

Comments

@mrylmz
Copy link

mrylmz commented Oct 6, 2021

Version Number: 8.0.3

Description

Selecting big ranges of dates around 2-3 years in range is causing performance penalties when finishing the selection due to sorting of big selected cell collections.

Parts of the call stack:

2.94 s   96.6%	0 s	 	                           JTACMonthView.selectDates(from:to:triggerSelectionDelegate:keepSelectionIfMultiSelectionAllowed:)
2.90 s   95.2%	0 s	 	                            JTACMonthView.selectDates(_:triggerSelectionDelegate:keepSelectionIfMultiSelectionAllowed:)
1.64 s   53.9%	0 s	 	                             JTACMonthView.handleSelectionValueChanged(_:action:indexPath:selectionType:shouldTriggerSelectionDelegate:)
1.52 s   49.8%	0 s	 	                              JTACMonthView.setMinMaxDate()
1.48 s   48.6%	0 s	 	                               specialized Sequence<>.sorted()

Steps To Reproduce

Select a big range of dates that at least contain 3-4 years of data

Expected Behavior

Date selection should not block the interface responsiveness.

Additional Context

Why are all selected cells cached in JTACMonthView.selectedCellData? It should be possible to infer the selected state of cells in between two dates by just checking if the start and end date range contains a given date.

@patchthecode
Copy link
Owner

Does the issue mentioned here help?
#1201

@mrylmz
Copy link
Author

mrylmz commented Oct 14, 2021

I need to check if it will resolve the issue. But back to the original question is there a reason why we are holding the dictionary with all the values in it? Because if there is no dependency to other related features we could do some major performance improvement in the library.

@patchthecode
Copy link
Owner

patchthecode commented Oct 14, 2021

Yes, I believe that I am using it.
In order to tell you how, I'll have to do a look at it again.
I'm a little tied up on another project, but i'll get back to this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants