Skip to content

Commit

Permalink
article: update title of pointer-params
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Nov 4, 2020
1 parent 6109308 commit 7721772
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Table of Content

- [Changkun Ou. Pointer Type May Not Be Ideal for Parameters. Oct 27, 2020.](./pointer-params.md)
- [Changkun Ou. Pointers Might Not Be Ideal for Parameters. Oct 27, 2020.](./pointer-params.md)
- [Changkun Ou. Eliminating A Source of Measurement Errors in Benchmarks. Sep 30, 2020.](./bench-time.md)

## License
Expand Down
8 changes: 4 additions & 4 deletions pointer-params.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pointer Type May Not Be Ideal for Parameters
# Pointers Might Not Be Ideal for Parameters

Author(s): [Changkun Ou](https://changkun.de)

Expand Down Expand Up @@ -209,9 +209,9 @@ The dumped assumbly code is as follows:

The `addv` implementation uses values from the previous stack frame and
writes the result directly to the return; whereas `addp` needs MOVQ that
copies the parameter to different registers (e.g., copy pointers to AX and CX,),
then write back when returning. Therefore, another unexpected cost in
`addp` is caused by the indirect addressing mode for accessing the memory unit.
copies the parameter to different registers (e.g., copy pointers to AX and CX),
then write back when returning. Therefore, with inline disabled, the reason that `addv`
is slower than `addp` is caused by different memory access pattern.

## Further Reading Suggestions

Expand Down
4 changes: 2 additions & 2 deletions pointer-params/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ GOVERSION=$(shell go version | awk '{print $$3}')
all:
perflock -governor 80% go test -v -run=none -bench=. -count=10 | tee $(GOVERSION).txt
benchstat $(GOVERSION).txt
asm:
mkdir asm && go tool compile -S vec.go > asm/vec.s
assembly:
go tool compile -S vec.go > asm/vec.s

0 comments on commit 7721772

Please sign in to comment.