Changeset fd84538


Ignore:
Timestamp:
Dec 16, 2020, 3:03:03 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
024fa4b
Parents:
2dd0689
Message:

changed locality benchmark to no longer use rand, which is too slow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/readyQ/locality.go

    r2dd0689 rfd84538  
    6161}
    6262
    63 
     63func __xorshift64( state * uint64 ) (uint64) {
     64        x := *state
     65        x ^= x << 13
     66        x ^= x >> 7
     67        x ^= x << 17
     68        *state = x
     69        return x
     70}
    6471
    6572func local(result chan uint64, start chan struct{}, size uint64, cnt uint64, channels [] Spot, share bool) {
    66         lrand := rand.New(rand.NewSource(rand.Int63()))
     73        state := rand.Uint64()
    6774        var data [] uint64
    6875        data = make([]uint64, size)
     
    7885        for true {
    7986                for i := uint64(0); i < cnt; i++ {
    80                         data[lrand.Uint64() % size] += 1
     87                        data[__xorshift64(&state) % size] += 1
    8188                }
    8289
    83                 i := lrand.Int() % len(channels)
     90                i := __xorshift64(&state) % uint64(len(channels))
    8491                data = channels[i].put(sem, data, share)
    8592                count += 1
Note: See TracChangeset for help on using the changeset viewer.