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

Validating each postcode on a CSV upload takes multiple seconds #147

Closed
mbarton opened this issue Jul 2, 2024 · 1 comment · Fixed by #325
Closed

Validating each postcode on a CSV upload takes multiple seconds #147

mbarton opened this issue Jul 2, 2024 · 1 comment · Fixed by #325

Comments

@mbarton
Copy link
Member

mbarton commented Jul 2, 2024

For each row in the CSV upload we validate the postcode against https://findthatpostcode.uk. This takes ~0.8 seconds per postcode meaning the time to process the CSV is roughly the number of rows in seconds. This feels quite slow to the user.

We look up the index of multiple deprivation for each postcode via our rcpch-census-platform API. This again validates the postcode but using postcodes.io instead.

postcodes.io allows bulk validation of up to 100 postcodes. We call it via our rcpch-census-platform API though so we'd need to add a bulk endpoint to that too.

We switched to findmypostcode in E12 as postcodes.io was missing some postcodes. (rcpch/rcpch-audit-engine#558, rcpch/rcpch-audit-engine#576). At the moment if the postcodes.io lookup fails (via the IMD call) then you'll just end up with no IMD. I'm not sure of the consequences of switching everything back. I don't believe findthatpostcode offer a bulk endpoint.

@mbarton
Copy link
Member Author

mbarton commented Jul 8, 2024

We'll win 0.1 seconds with this simple fix: rcpch/rcpch-census-platform#23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant