Set Ready For Review
To view, visit change 495878. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keith Randall, Martin Möhrmann, Matthew Dempsky.
2 comments:
Commit Message:
Patch Set #4, Line 19: Some benchmarks from json, fmt, runtime, strings packages:
The full benchmark data of the chain is in https://gist.github.com/egonelbre/34efef3f5c4aef2035396a2f0a90cc96
Patch Set #4, Line 106: SplitNMultiByteSeparator-32 212.9n ± 1% 260.2n ± 1% +22.19% (p=0.000 n=10)
I'll need to investigate what's going on here. Whether it's code layout, or some other reason.
To view, visit change 495878. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keith Randall, Martin Möhrmann, Matthew Dempsky.
1 comment:
File src/cmd/compile/internal/ssa/_gen/generic.rules:
Patch Set #4, Line 2621: (SliceLen (SelectN [0] (StaticLECall {sym} _ newLen:(Const(64|32)) _ _ _))) && isSameCall(sym, "runtime.growslicebyte") => newLen
I was wondering whether it would be use the rules to create the specialization rather than some other approach?
Something like:
```
(StaticCall {sym} oldPtr newLen oldCap num elemtype)) &&
isSameCall(sym, "runtime.growslice") &&
elemtype.Size() == 1 &&
elemtype.PtrBytes = 0
=> (StaticCall ??"runtime.growslicebyte"?? oldPtr newLen oldCap num)
```
Or whether this would be better than doing in `rewritegeneric`.
To view, visit change 495878. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Egon Elbre, Martin Möhrmann, Matthew Dempsky.
Patch set 4:Code-Review +2
4 comments:
File src/cmd/compile/internal/ssa/_gen/generic.rules:
Patch Set #4, Line 2621: (SliceLen (SelectN [0] (StaticLECall {sym} _ newLen:(Const(64|32)) _ _ _))) && isSameCall(sym, "runtime.growslicebyte") => newLen
I was wondering whether it would be use the rules to create the specialization rather than some othe […]
I think the way you are doing it is fine. There's no need to do it in rewrite rules if the choice is obvious when originally generating the SSA.
(It would be different if we were generating calls to growslice as part of some SSA passes, but I don't think that's the case.)
File src/cmd/compile/internal/ssagen/ssa.go:
Patch Set #4, Line 3467: && !et.HasPointers()
This is redundant, 1-byte types can't have pointers.
File src/cmd/compile/internal/walk/builtin.go:
Patch Set #4, Line 133: && !elemtype.HasPointers()
same here.
File src/runtime/slice.go:
Patch Set #4, Line 189: case et.Size_ == 1:
Probably leave a comment here, saying 1-byte grows should be using growslicebyte instead.
To view, visit change 495878. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Egon Elbre, Martin Möhrmann, Matthew Dempsky.
Patch set 4:Code-Review +1
Attention is currently required from: Egon Elbre, Martin Möhrmann.
Patch set 4:Code-Review +1
To view, visit change 495878. To unsubscribe, or for help writing mail filters, visit settings.
PTAL, based on comments from []string change, I ended up sharing the grow 32 and grow 64 logic here.
The full benchmark data of the chain is in https://gist.github.com/egonelbre/34efef3f5c4aef2035396a2f0a90cc96
outdated
SplitNMultiByteSeparator-32 212.9n ± 1% 260.2n ± 1% +22.19% (p=0.000 n=10)I'll need to investigate what's going on here. Whether it's code layout, or some other reason.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |