- Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
package:fixnumtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
The current implementation of Int64 stores the underlying integer as 3 integer fields:
class Int64 implements IntX { // A 64-bit integer is represented internally as three non-negative // integers, storing the 22 low, 22 middle, and 20 high bits of the // 64-bit value. final int _l, _m, _h; ... }Operations to/from a Dart int as well as arithmetic/bitwise operations will be slow due to need to operate on the combination of three fields.
On platforms such as the Dart VM or Dart2WasmGC we have support for unboxed int64 values where this overhead can be entirely avoided.
There's two improvements
- Use e.g. conditional imports to select better representation for
Int64on VM / Dart2WasmGC than for Dart2Js - Possibly avoid the creation of
Int64boxes entirely by having mechanism to pass unboxed values around
/cc @askeksa-google (since we just talked about it), @osa1 , @mraleph
Jure-BB, alexandrim0 and sigurdm
Metadata
Metadata
Assignees
Labels
package:fixnumtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug