karelkryda / universal-speedtest

This library allows you to test the speed of the Internet using several test sites.
https://www.npmjs.com/package/universal-speedtest
GNU General Public License v3.0
15 stars 5 forks source link

[BUG] unnecessary performance impact in upload test #18

Closed zkx5xkt closed 2 years ago

zkx5xkt commented 2 years ago

Describe the bug Object.keys(data) for string data lead to high performance impact (+gc) for long strings which block event loop for long time

To Reproduce -

Expected behavior -

Screenshots single speed test with default options: image

Desktop (please complete the following information):

Additional context -

karelkryda commented 2 years ago

Hello, thank you for the warning.

I replaced Object.values() with typeof data, which should solve the problem (can be tested in the latest version 2.0.5).

Have a nice day

zkx5xkt commented 2 years ago

You are amazing! I don't see any performance issues anymore.

Thank you

karelkryda commented 1 year ago

Hi @zkx5xkt,

Based on the problem you have raised here, I think you could potentially help me with my thinking about HTTP request libraries. Could you please visit this discussion?

Thank you in advance