|
|
@@ -225,53 +225,3 @@ with some caveats. See Encode documentation.
|
|
|
*/
|
|
|
package codec
|
|
|
|
|
|
-/*
|
|
|
-MID-STACK INLINING:
|
|
|
- - The code currently works optimally with fully enabled mid-stack inlining.
|
|
|
- This way, when enabled, we are already performant.
|
|
|
- - To see how well inlining is working, use the following scripts below:
|
|
|
-
|
|
|
- myblanklines 20
|
|
|
- zf=7; go build -gcflags "-m=2 -l=4" > $TMPDIR/a$zf.txt 2>&1
|
|
|
- for i in decReaderSwitch bytesDecReader bufioDecReader ioDecReader \
|
|
|
- encWriterSwitch bytesEncAppender bufioEncWriter ioEncWriter
|
|
|
- do echo ; grep -E "cannot inline \(\*${i}\)." $TMPDIR/a7.txt; done
|
|
|
-
|
|
|
- - When mid-stack inlining is enabled, consider doing the following:
|
|
|
- - if 41<=inlineExtraCallCost<=56,
|
|
|
- make (buf)ioEncWriter.{writen1,writen2,writestr,writeb,atEndOfEncode} go:noinline
|
|
|
- - if <=40,
|
|
|
- do nothing (no go:inline)
|
|
|
-
|
|
|
-TODO:
|
|
|
- - remove Deprecated APIs,
|
|
|
- especially those only used by files generated by old versions of codecgen.
|
|
|
- this is ok, as we have updated the GenVersion, ensuring that old ones break anyway.
|
|
|
-
|
|
|
-PUNTED:
|
|
|
- - To make Handle comparable, make extHandle in BasicHandle a non-embedded pointer,
|
|
|
- and use overlay methods on *BasicHandle to call through to extHandle after initializing
|
|
|
- the "xh *extHandle" to point to a real slice.
|
|
|
-
|
|
|
-BEFORE EACH RELEASE:
|
|
|
- - Look through and fix padding for each type, to eliminate false sharing
|
|
|
- - critical shared objects that are read many times
|
|
|
- TypeInfos
|
|
|
- - pooled objects:
|
|
|
- decNaked, decNakedContainers, codecFner, typeInfoLoadArray,
|
|
|
- - small objects allocated independently, that we read/use much across threads:
|
|
|
- codecFn, typeInfo
|
|
|
- - Objects allocated independently and used a lot
|
|
|
- Decoder, Encoder,
|
|
|
- xxxHandle, xxxEncDriver, xxxDecDriver (xxx = json, msgpack, cbor, binc, simple)
|
|
|
- - In all above, arrange values modified together to be close to each other.
|
|
|
- For all of these, either ensure that they occupy full cache lines,
|
|
|
- or ensure that the things just past the cache line boundary are hardly read/written
|
|
|
- e.g. JsonHandle.RawBytesExt - which is copied into json(En|De)cDriver at init
|
|
|
-
|
|
|
- Occupying full cache lines means they occupy 8*N words (where N is an integer).
|
|
|
- Check this out by running: ./run.sh -z
|
|
|
- - look at those tagged ****, meaning they are not occupying full cache lines
|
|
|
- - look at those tagged <<<<, meaning they are larger than 32 words (something to watch)
|
|
|
- - Run "golint -min_confidence 0.81"
|
|
|
-*/
|