Age | Commit message (Collapse) | Author |
|
Change build directives to avoids additional external dependency
(golang.org/x/sys/unix) at the cost of small performance degradation
when handling integers.
Bug: 172923994
Test: treehugger
Change-Id: I11aa727031a523a309ba9372300e6d413847e02d
|
|
Also, enable the optimization on other POSIX platforms.
|
|
Fixes #290
|
|
The recent int change didn't compile on 386. Fixed.
Thanks to user @anyktx for pointing this out.
Also, tests of string * int and tuple * int printed a bad
error message containing an integer overflow. Now fixed.
|
|
* int: consolidate field accessors
This change defines low-level accessors for the small and big
arms of the int union so that the representation can be easily
changed in a follow-up.
Change-Id: I7c4ae279a6d2e7b76e102ba5d01a3cd1c56fb368
* int: improve performance by avoiding allocation
This change defines a new representation for Int on 64-bit machines
running a POSIX operating system, by reserving a 4GB portion of the
address space.
Pointers to addresses in this region represent int32 values,
and are disjoint from all *big.Int pointers,
allowing us to represent the union in a single pointer.
This means the conversion from Int to Value does not allocate.
The gauss benchmark (added in this CL) shows -40% ns, -48% bytes, -63% allocs:
Benchmark/bench_gauss-12 84 13648744 ns/op 3175816 B/op 105862 allocs/op (before)
Benchmark/bench_gauss-12 55 24283703 ns/op 6119844 B/op 289862 allocs/op (after)
On 32-bit machines, or those running a non-POSIX system,
we continue to use the old representation.
|