Improve image optimization run-time and memory usage #457
Merged
a258wang
merged 8 commits from amy-image-optimization-quick-fix
into main
10 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'amy-image-optimization-quick-fix'
Deleting a branch is permanent. It CANNOT be undone. Continue?
This PR aims to resolve the issues surrounding the optimize-images script, at least in the short term, in order to unblock other work.
Problems: Our optimize-images script was taking a very long time to run (~7 minutes in CI, when successful). This led to two problems:
Solutions:
images/events
prior to optimizing them, similar to what is done for the images inimages/team
. This solution on its own reduced the run-time of the script to ~30 seconds locally on Amy's laptop, which is comparable to the run-time of the script back when it was originally written.As a temporary fix, this PR also replaces the images inimages/events
with their resized + optimized versions. (For some unknown reason, Solution 1 is not sufficient to solve Problem 2.)This PR also adds some logging to the script so we can get a (slightly) better sense of where the script is getting stuck.
Related issue: #456
Improve image optimization run-timeto WIP: Improve image optimization run-time (quick fix) 10 months agoWIP: Improve image optimization run-time (quick fix)to Improve image optimization run-time (quick fix) 10 months agoImprove image optimization run-time (quick fix)to Improve image optimization run-time - quick fix 10 months agoNice catch!! Makes sense why those specific images were taking so long now… this solution is great!
I think this solution is good enough to solve our problems for now. In the future, we should consider an alternative image storage mechanism anyway...
void optimizeImages();
export async function optimizeImages() {
const startTime = Date.now();
By the way, JavaScript has a built in
console.time()
https://developer.mozilla.org/en-US/docs/Web/API/console/time
Improve image optimization run-time - quick fixto Improve image optimization run-time 10 months agoImprove image optimization run-timeto Improve image optimization run-time and memory usage 10 months agoRe-requested reviews because I made a pretty significant change - see PR description for update
"Revert "Revert "Revert
:)443925190e
into main 10 months agoReviewers
443925190e
.