Skip to content
Snippets Groups Projects

Events broker

Merged Daniel Lyubomirov requested to merge events into master
1 unresolved thread

The events are polled every second and dispatched through gRPC streams.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
37
38 for (int64_t i = 0; i < iterations; i++) {
39 if (q.IsFull()) {
40 q.PopFront();
41 }
42
43 q.PushBack(i);
44 }
45
46 auto end = clock::now() - start;
47
48 std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(end).count() << std::endl;
49 std::cout << std::chrono::duration_cast<std::chrono::nanoseconds>(end).count()/iterations << std::endl;
50
51 while (!q.IsEmpty()) {
52 s += q.Front();
  • This will overflow s

  • Sorry about this, that I didn't delete it before submitting the MR. The csandbox is a scratch pad where i do some fast code testing and benchmarking. It is not used in the code of the library.

    Fun fact about the benchmark, and the s. The s is needed and you have to print it to the stdout, since without it the compilers these days are so good in optimization, that they will completely discard the for loop that i am benchmarking, since they will detect that this loop does no side effect and is in fact not needed :).

    Edited by Daniel Lyubomirov
  • Please register or sign in to reply
  • added reviewed label

  • mentioned in commit d7d3a0e8

  • Please register or sign in to reply
    Loading