Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkReaderWriteToOptimal (0.54 sec)

  1. src/bufio/bufio_test.go

    	dstBuf := new(bytes.Buffer)
    	dst := onlyWriter{dstBuf}
    	for i := 0; i < b.N; i++ {
    		srcBuf.Reset()
    		srcReader.Reset(srcBuf)
    		dstBuf.Reset()
    		io.Copy(dst, src)
    	}
    }
    
    func BenchmarkReaderWriteToOptimal(b *testing.B) {
    	const bufSize = 16 << 10
    	buf := make([]byte, bufSize)
    	r := bytes.NewReader(buf)
    	srcReader := NewReaderSize(onlyReader{r}, 1<<10)
    	if _, ok := io.Discard.(io.ReaderFrom); !ok {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Nov 01 21:52:12 UTC 2024
    - 51.6K bytes
    - Viewed (0)
Back to top