mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Limit SelectAllEvents benchmark to 512 FDs
...since `select` only supports FD values up to 1024 and creating 1024 event FDs will result in FD values that are greater than 1024 because of the initial set of FDs that exist for most programs (stdin, stdout, stderr). https://www.man7.org/linux/man-pages/man2/select.2.html PiperOrigin-RevId: 573916775
This commit is contained in:
committed by
gVisor bot
parent
2165031c02
commit
15fdd74e5c
@@ -46,6 +46,8 @@ void Setup(int count, std::vector<FileDescriptor>& event_fds, fd_set& read_fds,
|
||||
FD_SET(fd.get(), &read_fds);
|
||||
event_fds.push_back(std::move(fd));
|
||||
}
|
||||
|
||||
ASSERT_LT(max_fd, FD_SETSIZE);
|
||||
}
|
||||
|
||||
// Benchmarks a call to select(2) when no FD is "ready" with varying timeout
|
||||
@@ -94,7 +96,7 @@ void BM_SelectAllEvents(benchmark::State& state) {
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK(BM_SelectAllEvents)->Range(/*start=*/2, /*limit=*/1024);
|
||||
BENCHMARK(BM_SelectAllEvents)->Range(/*start=*/2, /*limit=*/512);
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user