Improving performance in numerical computations
Unlike Java and C#, who have dedicated 8, 16, 32, and 64 bit signed and unsigned integer types, and 32-bit and 64-bit floats, Dart does not have bounded integer types or 32-bit floating point number types; it only has two numeric types, int
(an arbitrarily sized integer) and double
(conforming to the IEEE-754 spec), and their super type num
. This was done to make the language more dynamic and easier to learn and use. However, the Dart VM does a good job of inferring the range of integers, and optimizes whenever possible. Here, we provide a number of discussions and tips to give your code the highest performance possible when it involves numerical computing.
How to do it...
The VM uses three integer ...
Get Dart: Scalable Application Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.