pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


RDBSS collapsing benchmark #001
Posted by Anonymous on Fri 28th Nov 2025 11:58
raw | new post

  1. $ cat open_x_c_100times.c
  2. #include <windows.h>
  3. int main() {
  4.     CreateFileA("x.c", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
  5.     for(int i=0;i<100000;i++) {
  6.         HANDLE h;
  7.         h = CreateFileA("x.c", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
  8.         CloseHandle(h);
  9.     }
  10.     return 0;
  11. }
  12.  
  13. # with collapsing enabled:
  14. $ time ./open_x_c_100times
  15.  
  16. real    3m20.027s
  17. user    0m0.562s
  18. sys     0m34.296s
  19. # collapsing disabled:
  20. $ time ./open_x_c_100times
  21.  
  22. real    6m59.528s
  23. user    0m1.155s
  24. sys     0m48.936s

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at