Skip to content

Remove minification from translations to reduce build time by 1.5mins #7552

Merged
bramkragten merged 1 commit intohome-assistant:devfrom
rob-mccann:no-minify-tx
Oct 30, 2020
Merged

Remove minification from translations to reduce build time by 1.5mins #7552
bramkragten merged 1 commit intohome-assistant:devfrom
rob-mccann:no-minify-tx

Conversation

@rob-mccann
Copy link
Contributor

@rob-mccann rob-mccann commented Oct 30, 2020

Proposed change

I noticed it took a little while in the build-flattened-translations gulp task. I profiled the task via node --inspect and saw time spent in minification. Given the translations are already pure json files on a single line, I wondered if the minification was having any impact. I ran an MD5 hash over the build-translations directory before and after commenting the line out and it gave the same hashes.

Removing the line took this task down from 1.2 minutes to a couple of seconds on my Macbook pro 15. I removed the build-translations directory between runs.

Before:
image

After:
image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

Copy link
Member

@bramkragten bramkragten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool! That's way faster!

You should also remove the gulp-jsonminify dependency

@rob-mccann
Copy link
Contributor Author

@bramkragten done

@zsarnett
Copy link
Contributor

Thank you! 🎉

Copy link
Member

@bramkragten bramkragten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bramkragten bramkragten merged commit 3dedbc5 into home-assistant:dev Oct 30, 2020
@donkawechico
Copy link
Contributor

THANK YOU @rob-mccann!!! This is one of those "unsung hero" improvements that never make it to the blog but quietly lead to more features because of how much it improves development flow.

Great job.

@rob-mccann rob-mccann deleted the no-minify-tx branch October 30, 2020 15:02
@bramkragten bramkragten mentioned this pull request Nov 11, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants