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

HttpRequest.files performance issue #69

Open
mikejshea opened this issue Sep 8, 2020 · 1 comment
Open

HttpRequest.files performance issue #69

mikejshea opened this issue Sep 8, 2020 · 1 comment
Assignees

Comments

@mikejshea
Copy link

I'm attempting write a simple Azure Function that reads an XML file sent in using multipart/form-data as seen in the below curl sample (the file is about 7.5MB).

curl --location --request POST 'http://localhost:7071/api/HttpTrigger1' \
--header 'Content-Type: multipart/form-data' \
--form 'gpxFile=@/C:/somefile.XML'

When I use this line of code using the Azure Functions Python Library to access the data:
x = req.files.get('gpxFile').stream.read().decode("utf-8")
I'm seeing about 15 second response times.

A similar line using Flask:
x = request.files['gpxFile'].read().decode("utf-8")
returns in about 1.5 seconds.

Am I using the HttpRequest object incorrectly? If not, why does Flask request respond so much quicker then the Azure HttpRequest?

@stefanushinardi
Copy link

@Hazhzeng to further investigate

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

No branches or pull requests

3 participants