Skip to content

Speed up the loading of the geolocation data - #7527

Merged
FreeTubeBot merged 1 commit into
FreeTubeApp:developmentfrom
absidue:perf-geolocations
Jun 8, 2025
Merged

FreeTubeBot merged 1 commit into
FreeTubeApp:developmentfrom
absidue:perf-geolocations

Conversation

@absidue

@absidue absidue commented Jun 7, 2025 •

Copy link
Copy Markdown
Member

Pull Request Type

  • Performance improvement

Description

Currently the geolocation files have this format { name: string, code: string }[], but at runtime we need two separate arrays, one containing the names and the other ones the codes, which requires us to map them into those two array at runtime. Those files are generated by our getRegions.mjs script, so we could generate them in a format that avoids that mapping at runtime, which is exactly what this pull request does, by changing to the format to { names: string[], codes: string[] }.

As an added benefit these changes also reduces the total size of the geolocation JSON files from 178647 bytes (~174 KB) down to 96867 bytes (~94.5 KB).

Testing

Change the "Locale Preference" in the "General" settings and check that the names in the "Region for Trending" dropdown still get updated to match the current "Locale Preference".

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0fb7f12

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) June 7, 2025 13:28
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jun 7, 2025
@FreeTubeBot
FreeTubeBot merged commit f9a4227 into FreeTubeApp:development Jun 8, 2025
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jun 8, 2025
@absidue
absidue deleted the perf-geolocations branch June 8, 2025 06:24
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Jun 10, 2025
…urrent

* fix/electron-video-playback-error: (25 commits)
  Bump electron-builder from 26.0.15 to 26.0.16 (FreeTubeApp#7539)
  Bump eslint-plugin-vue from 10.1.0 to 10.2.0 in the eslint group (FreeTubeApp#7537)
  Bump webpack-dev-server from 5.2.1 to 5.2.2 (FreeTubeApp#7538)
  Bump electron from 36.3.2 to 36.4.0 (FreeTubeApp#7540)
  Translated using Weblate (Hungarian)
  Migrate FtPlaylistAddVideoPrompt and FtPlaylistSelector to the composition API (FreeTubeApp#7511)
  Speed up the loading of the geolocation data (FreeTubeApp#7527)
  Remove unnecessary barrel file in store (FreeTubeApp#7522)
  Translated using Weblate (Bulgarian)
  add rules to issue templates (FreeTubeApp#7516)
  Translated using Weblate (Romanian)
  Translated using Weblate (Serbian)
  Translated using Weblate (Russian)
  Move settings to `more` menu on smaller mobile devices (FreeTubeApp#7506)
  Translated using Weblate (Russian)
  Migrate WatchVideoLiveChat to the composition API (FreeTubeApp#7494)
  Translated using Weblate (Basque)
  Translated using Weblate (Russian)
  Bump shaka-player from 4.14.14 to 4.14.15 (FreeTubeApp#7501)
  Bump electron from 36.3.1 to 36.3.2 (FreeTubeApp#7500)
  ...
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

Successfully merging this pull request may close these issues.

5 participants