Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7310

benchRun() doesn't generate random distribution within the specified range

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.1
    • Affects Version/s: None
    • Component/s: Performance
    • ALL

      rand() returns an integer between 0 and RAND_MAX, which is 32767 on posix systems. Thus using #RAND_INT in benchRun() will not create an even distribute for a large range. See bench.cpp L300:

      int x = min + ( rand() % ( max - min ) );

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            benjamin.becker Ben Becker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: