Description
- Version: 10.0.0
- Platform: Linux PC 5.0.10-arch1-1-ARCH deps: update openssl to 1.0.1j #1 SMP PREEMPT Sat Apr 27 20:06:45 UTC 2019 x86_64 GNU/Linux
- Subsystem: v8
Not sure if this is the right place but I may have found a possible performance issue in NodeJS JavaScript execution.
While execution of this example script on a NodeJS runtime <10.0.0 runs smoothly, it freezes on NodeJS runtimes >= 10.0.0 for an indefinite amount of time.
I tested the script for all latest major releases of NodeJS and got the following results:
- 8.16.0: Runs smoothly
- 9.11.2: Runs smoothly
- 10.0.0: Freeze
- 10.15.3: Freeze
- 11.15.0: Freeze
- 12.2.0: Freeze
I tested the script on different machines (including windows hosts), always getting the same result.
Due to the facts that the example-script is a pure JavaScript file with no dependencies on any NodeJS or external modules, and that the issue occurred first in NodeJS version 10.0.0 I assume that it has to do something with the upgrade of V8 Runtime from 6.2 to 6.6, which was listed in the changelog ov NodeJS version 10.0.0.
NB: I discovered this issue after upgrading a service to newest NodeJS runtime. The service is responsible for validating arbitrary Data against a defined JSONSchema. Validation is implemented using an external library called AJV. After the update, the service started to freeze sporadically during validation process. The provided example script therefore contains an example of a validation function generated by AJV library and some sample data (array of 1000 elements) for which validation will freeze after some time (on my machine, depending on NodeJs version at element no ~594 or no ~610).