-
Notifications
You must be signed in to change notification settings - Fork 361
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
Optimization PINMemoryCache
trim to date
#252
Merged
jparise
merged 7 commits into
pinterest:master
from
kinarobin:optimize_memory_trim_to_date
Mar 2, 2020
Merged
Optimization PINMemoryCache
trim to date
#252
jparise
merged 7 commits into
pinterest:master
from
kinarobin:optimize_memory_trim_to_date
Mar 2, 2020
Conversation
This file contains 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
Yes! It's not your fault, it's the build machine, I'll either fix or merge, thank you for the PR! |
Adlai-Holler
approved these changes
Jul 15, 2019
…arob/PINCache into optimize_memory_trim_to_date
@garrettmoon. Could you take a look ? Thanks! |
🚫 CI failed with log |
jparise
approved these changes
Mar 2, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, and CI is now fixed and passing. Thanks for the improvement, @kinarobin!
adlerj
pushed a commit
to adlerj/PINCache
that referenced
this pull request
Aug 4, 2020
* commit 'df60b0d9c1903ca4cdb1e928b04ea1203aa28ad2': Support Catalyst (pinterest#272) Fix the grammar in an assertion failure message (pinterest#270) Remove the unused CI directory (pinterest#265) Fix up analyze for github CI (pinterest#264) Check fileURL outside of the locked scope (pinterest#262) Optimization `PINMemoryCache` trim to date (pinterest#252) Use correct class name in NSAssert() messages (pinterest#263) Remove Danger from the project (pinterest#261) Link to master branch workflow from the CI badge Test that the "remove object" blocks are called (pinterest#258) Fix GitHub Actions CI badge Switch to GitHub Actions for CI (pinterest#259) Discrepancy between Header Comment and Implementation (pinterest#257) # Conflicts: # Makefile # PINCache.xcodeproj/project.pbxproj # Tests/PINCacheTests.m
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.
I notice
PINMemoryCache
had some usage for trim to age limit recursively.Every time ordering the
createdDates
for trim to age is so expensive, and we don't use the sort of container any more for other scene.So, instead of sort the container, we could delete the expired objects with a
for loop
directly.Time Complexity: (√n * n + (expired count) ) -> n