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

Examine Django-countries[pyuca] Memory Usage and lexical sorting #35220

Open
ormsbee opened this issue Aug 2, 2024 · 1 comment
Open

Examine Django-countries[pyuca] Memory Usage and lexical sorting #35220

ormsbee opened this issue Aug 2, 2024 · 1 comment
Labels
performance Relates to improving latency/throughput or reducing resource usage

Comments

@ormsbee
Copy link
Contributor

ormsbee commented Aug 2, 2024

About 4-5% of LMS memory usage comes from pyuca, which as far as I can tell is used in our system to give django-countries a better sort order (it's an optional dependency of that package). This is because Unicode sorting is quite complex, involving multiple layers of lookup tables and glyph translations to handle many language-specific quirks.

How different is the sort order without pyuca installed, and how much does it matter? It must have some level of importance for them to bundle it with django-countries the way they did, but I'm not clear on how critical it is.

(Making a ticket for this for later followup since I don't have time to dig into it now.)

@ormsbee
Copy link
Contributor Author

ormsbee commented Aug 4, 2024

Okay, this was just bugging me this weekend, so I did a quick script to see what the difference in ordering actually is for the django-countries languages we support in edx-platform:

with-pyuca.zip
without-pyuca.zip

While we could bundle pre-created lists of countries by language, it's also possible to do this sorting all on the client side now, since all major browsers support locale-aware sorting in JavaScript–and since we're moving to MFEs for everything, that's probably our best bet in the longer term anyhow.

@ormsbee ormsbee added the performance Relates to improving latency/throughput or reducing resource usage label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Relates to improving latency/throughput or reducing resource usage
Projects
None yet
Development

No branches or pull requests

1 participant