10 ms·
Isn't that like saying X compiles to assembly as so should be as efficient as assembly? I'm not an expert on the internals of typescript. But your comment does
by benj111 5mo ago
Isn't that like saying X compiles to assembly as so should be as efficient as assembly?
I'm not an expert on the internals of typescript. But your comment doesn't indicate you are an expert either.
- heijmans 5mo agoYou don't have to be an expert in TypeScript to know that the TypeScript compiler just strips the types from the code and leaves the rest as-is (if you are targeting a somewhat modern JS engine). The runtime performance of a TypeScript program is the same as that of the equivalent JavaScript program. But of course, a TypeScript program could be much slower than a different JavaScript program, as is probably happening in this case. I agree with others that the difference in results between JavaScript and TypeScript makes the quality of this paper highly suspect.
- benj111 5mo agoWell you need to know enough to know whether it's doing run time checks also. And also whether it's generating less efficient code to satisfy the type safety requirement.
- Thiez 5mo agoIt isn't. Typescript is basically javascript with type annotations. There is a shorthand for class member initialisation and for defining enums, but that's basically it. There are no extra safety checks inserted. You get compile-time typechecking and nothing else.
- eddd-ddde 5mo agoIt's more like comparing assembly against the same program but with comments.