-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add CoffeeScript 2.7.0 #277
Comments
If updating to CS 2+ is currently out of scope, then simply switching over to the current latest JS Node runner (v18.x) will give significantly improved assertion behaviour and performance. |
The actual performance improvement of the v18.x runner over the v8.7.0 runner is more than an order of magnitude when working with specific assertions. Using the compiled JS output of this translation in a kumite (with random test specifications changed to match other languages rather than the limited ones implemented for the Node v8 runner) gives a speedup from timeout to ~200ms runtime. To verify my findings simply fork the kumite and run the tests with different Node runners selected. |
I know this is confusing, but Chai is an assertion package and not a test framework. Mocha is the test framework used in Node 10+ and TypeScript. It provides I'm sure the newer Node version is faster, but you can't really compare the performance of tests between Node v8 and v18 on Codewars because Node v8 is not using Mocha+Chai.
Are you comparing the performance of
As I wrote in #233, the difference for the test output is the test framework. In Kumite, you can try Mocha with Node v8 by changing the test framework on the bottom right. If we decide to add CoffeeScript 2, we'll use Mocha and the latest LTS Node. |
I am comparing |
Cool. CoffeeScript has Chai v3.5.0. Node v12/v14/v18 has Chai v4.3.x. |
|
@kazk @ejini6969 was wondering when any potential updates to CS will commence and if there is anything from our side that can help (PRs or similar)? He says he's planning on updating all current CS kata to use Chai assertions this weekend as well, and is wondering if that is needed or it can be automated from your end? |
To maximize future compatibility with Mocha, make sure to have the valid test structure and use nullary functions. See the list at the top of List of JavaScript Kata to Update for more details. We can provide assertions from Also, make sure the tests are not using Node's |
Changelogs can be found at coffeescript.org.
The main rationale behind requesting this update is due to the extremely outdated (and slow) Node version (v 8.7.0) that the current CS 1.10.0 runner is using. This will also make transitioning away from the Codewars test framework to the
chai
framework used by the JS/TS runners easier, aschai
assertions (and assertions in general) behave very poorly on Node v8, pictured below.An assertion being run on the Node v8 JS/CS runner:
The same assertion being run on the Node v10 JS runner:
This is an issue as for Kata with large expected outputs, for example The Observed Pin, where the output buffer can become entirely filled without having chai truncate the test output and giving the solver unhelpful error messages such as
expected [ Array(1440) ] to deeply equal [ Array(1440) ]
. The performance of certain assertions also seems to be severely degraded on the current runner, as a single deep equality check between two ~30000 element arrays takes over 12000ms on its own.The text was updated successfully, but these errors were encountered: