• Russ Cox's avatar
    gc: optimize interface ==, != · f91cc3bd
    Russ Cox authored
    If the values being compared have different concrete types,
    then they're clearly unequal without needing to invoke the
    actual interface compare routine.  This speeds tests for
    specific values, like if err == io.EOF, by about 3x.
    
    benchmark                  old ns/op    new ns/op    delta
    BenchmarkIfaceCmp100             843          287  -65.95%
    BenchmarkIfaceCmpNil100          184          182   -1.09%
    
    Fixes #2591.
    
    R=ken2
    CC=golang-dev
    https://golang.org/cl/5651073
    f91cc3bd
runtime_test.go 645 Bytes