Skip to content

Add send benchmark #238

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add send benchmark #238

wants to merge 5 commits into from

Commits on Mar 18, 2022

  1. send: Add network bandwidth benchmark

    Copy from `~buczek/src/small/send.c`.
    donald authored and pmenzel committed Mar 18, 2022
    Copy the full SHA
    8f6938f View commit details
    Browse the repository at this point in the history
  2. send: Specify int as main()’s return type and include string.h

    Fix the warnings below:
    
        $ make send
        cc     send.c   -o send
        send.c:41:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
         main(int argc,char *argv[]) {
         ^~~~
        send.c: In function ‘main’:
        send.c:63:5: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration]
             memset(buffer,0xA3,sizeof(buffer));
             ^~~~~~
        send.c:63:5: warning: incompatible implicit declaration of built-in function ‘memset’
        send.c:63:5: note: include ‘<string.h>’ or provide a declaration of ‘memset’
        send.c:79:5: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
             memcpy(&sin.sin_addr,he->h_addr,he->h_length);
             ^~~~~~
        send.c:79:5: warning: incompatible implicit declaration of built-in function ‘memcpy’
        send.c:79:5: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
    
    Reported-by: gcc (GCC) 7.5.0
    pmenzel committed Mar 18, 2022
    Copy the full SHA
    d7f0aa3 View commit details
    Browse the repository at this point in the history
  3. send: Strip trailing spaces

    pmenzel committed Mar 18, 2022
    Copy the full SHA
    907197f View commit details
    Browse the repository at this point in the history
  4. send: Build, track and install executable

    Build with `make send`, add it to the git archive, and install it to
    `/usr/bin`.
    pmenzel committed Mar 18, 2022
    Copy the full SHA
    a842a94 View commit details
    Browse the repository at this point in the history
  5. send: Make byteCount unsigned long

    Currently, negative benchmark values are shown:
    
        @ira$ send okeanos 34141
        start : 1647613816.868339
        close : 1647613826.868524
        done  : 1647613826.874427
        -1209148824 bytes in 10.006088 seconds
        -120841314.207910 bytes / seconds
        -966730513.663282 bits  / seconds
        -966730.513663 kBit/s  / seconds
        -966.730514 MBit/s  / seconds
    
    With 10 Gbit/s, in 10 s seconds theoretically up to 12.5 GB could be
    transferred. But a 32-bit (signed) integer can at maximum store the
    number (2147483648 - 1), and the unsigned integer around 4.3 million,
    still too small.
    
    Therefore, use unsigned long to be able to store the number bytes
    without overflow for the foreseeable future. Now we have:
    
        @ira$ ./send okeanos 34141
        start : 1647626064.313421
        close : 1647626074.313503
        done  : 1647626074.317791
        10534190976 bytes in 10.004370 seconds
        1052958954.536867 bytes / seconds
        8423671636.294939 bits  / seconds
        8423671.636295 kBit/s  / seconds
        8423.671636 MBit/s  / seconds
    
    Resolves: mariux64/mariux64-issues#23
    pmenzel committed Mar 18, 2022
    Copy the full SHA
    08e1a93 View commit details
    Browse the repository at this point in the history