v8 / node

Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:
https://nodejs.org
Other
171 stars 66 forks source link

Remove use of deprecated type v8::FastApiTypedArray #197

Closed gahaas closed 3 months ago

gahaas commented 3 months ago

In the examples where v8::FastApiTypedArray was used, there is actually no advantage of using V8's fast API calls instead of regular API calls. Therefore this CL just removes the fast API call targets instead of adjusting them.

ronag commented 3 months ago

@gahaas we have been benchmarking alternatives to v8::FastApiTypedArray and they are all significantly slower.¨

Refs: https://github.com/nodejs/node/pull/54103 Refs: https://github.com/nodejs/node/pull/54087

gahaas commented 3 months ago

@ronag What exactly did you measure? If I remember correctly, the performance regression of removing v8::FastApiTypedArray was 6 CPU cycles per call. In a micro-benchmark that calls an empty API function, this regression was indeed clearly measurable, but as soon as I added reasonable workload, I could not measure a difference anymore.

ronag commented 3 months ago

memmove 64 bytes.

ronag commented 3 months ago

Pleas see the references

gahaas commented 3 months ago

Thank you for making me aware of this issue. Could you please file a bug in the V8 bug tracker.

Please add information on how I can reproduce the issue locally.

Does node compile with PGO and LTO? I could imagine that the issue is that some API function calls get inlined in Chrome but not in node, as that would explain the different performance behavior.

ronag commented 3 months ago

Does node compile with PGO and LTO? I could imagine that the issue is that some API function calls get inlined in Chrome but not in node, as that would explain the different performance behavior.

@targos Do you know someone that can answer this?

ronag commented 3 months ago

@gahaas https://issues.chromium.org/u/0/issues/356158110