Closed pizberg closed 1 year ago
Hey @pizberg,
as stated in the docs, Chevrotain is optimized to run very well on the V8 engine, which is used in Edge and Chromium and most notably Node.js. Since Apple does not allow other web engines on their mobile devices, both Edge and Safari use the webkit engine.
So, Chevrotain being slower on other platforms is kind of expected in that regard. Do you have special requirements that need you to run a lot of data through Chevrotain on Mac/mobile devices? I would imagine that the high performance of Chevrotain is only really useful when you start parsing lot of source code in server environments (Node.js).
Hi, @msujew , Thanks for the explanation. I'm just confused by the test results, not for any high performance requirement with webkit engine.
Hello.
This is not a Windows / Mac question, instead it is about the JavaScript engine used.
Chevrotain is generally optimized for V8 (Chrome / NodeJS / Edge (in newer versions)).
There are a few factors that can affect this:
Here are my results on my M1 MacBook Pro
Edge (which uses V8)
Firefox (still pretty good compared to other libraries)
Since Apple does not allow other web engines on their mobile devices, both Edge and Safari use the webkit engine.
Oh, I did not know Edge of mobile IOS does not use V8
@bd82 Apple is quite clear on that in their review guidelines. No app published on the app store is allowed to bring their own JS/Web rendering engine.
Hi, @bd82 Thanks, this information is useful
I'll close this for now, re-open if there are any other related questions.
It might be a good idea to revisit the code to see if it is still valid. I see a more recent approach here: https://github.com/sindresorhus/to-fast-properties/blob/main/index.js
Thanks @mattbishop I actually did attempt to use this more modern version, see details here:
Window Edge:![image](https://user-images.githubusercontent.com/10650959/184496435-e393e6d5-ce77-4ed3-813b-a7fa126205ab.png)
iPhone Edge:![95159f37cbb36378e1a49d08169747e](https://user-images.githubusercontent.com/10650959/184496410-7608e5ba-85f8-4669-95e8-51fb2de22138.jpg)