Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to
5.6ms (and 0 mallocs). It's still relatively slow since it assumes
nothing about the src or mask images, but it does remove the malloc.
There are existing faster, more specialized paths for copies, fills
and image glyph masks.
Also added a "compare to a slow but obviously correct implementation"
check to draw_test.go.
R=rsc, r
CC=golang-dev
https://golang.org/cl/1223044
- implemented setWord, use it where setUint64 is wrong
- divLarge: use fast mulWW, divWW; implemented mulWW, divWW
- better assembly code for addMulVVW
R=rsc
CC=golang-dev
https://golang.org/cl/1258042
Previously the compiler would just emit "internal compiler error" when
trying to compute the remainder of floats or complex types.
R=rsc
CC=golang-dev
https://golang.org/cl/1243041
- support for binary prefix 0b (to match fmt.Format)
- renamed nat.new -> nat.setUint64 for consistency
- more tests
R=r
CC=golang-dev
https://golang.org/cl/1233041
Also update range of Phase and Polar due to signed zero.
[Phase(cmplx(-1, +0)) = pi and Phase(cmplx(-1, -0)) = -pi]
R=rsc, r
CC=golang-dev
https://golang.org/cl/1235041
- also added links to the respective sections
- reformatted section for better (source html) readability
- added missing closing </li>'s in many places
R=r
CC=golang-dev
https://golang.org/cl/1220041
Timings (as for change 1122043) go from 49ms to 48ms ish. It's
mostly lost in the noise, but it probably doesn't hurt.
R=r
CC=golang-dev
https://golang.org/cl/1179041
To draw.Draw a 32x32 image.Alpha 10000 times,
Before: 633ms with 10000 mallocs
After: 49ms with 0 mallocs
These times are just blitting an image.Alpha, and do not include
rasterizing a glyph's vector contours to an image.Alpha.
The "generic" test case in draw_test.go tests this fast path.
R=rsc
CC=golang-dev
https://golang.org/cl/1122043
- removed last argument (n) from all core arithmetic routines;
instead, use the length of the result
- simplified nat.make implementation and chose a better capacity
for new values, removed a TODO in the process
Changing the constant e from 1 (old) to 4 (new) improved
pidigits -s -n 10000 by ~9% (on a 3.06GHz Intel Core 2 Duo):
user 0m3.882s (old)
user 0m3.549s (new)
R=rsc
CC=golang-dev
https://golang.org/cl/1133043
This permits cgo callbacks to work when run in init code.
Otherwise cgocallback switches to the wrong stack address.
R=rsc
CC=golang-dev
https://golang.org/cl/1123043
- no need to make copies in cases of aliases
- removed deprecated internal shift functions
- minor unrelated simplifications
This change improves pidigits -s -n10000 by almost 20%:
user 0m6.156s (old)
user 0m4.999s (new)
(pidigits -s -n20000 goes from ~25s to ~19s)
R=rsc
CC=golang-dev
https://golang.org/cl/1149041
Because maps are mostly a hidden type, they must be
implemented using reflection values and will not be as
efficient as arrays and slices.
R=rsc
CC=golang-dev
https://golang.org/cl/1127041