octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57439] handles to private functions may fail


From: Rik
Subject: [Octave-bug-tracker] [bug #57439] handles to private functions may fail after "clear functions"
Date: Thu, 12 Mar 2020 15:06:56 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #48, bug #57439 (project octave):

Benchmarking shows that access() is about 8% slower than stat() on my
machine.

Test code for stat() in stat_bm.cpp:


//#include <iostream>
#include <string>

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

using namespace std;

int main()
{
   const int LOOPMAX = 1e7;
   const string path = "/home/rik/wip/Projects_Mine/octave-dev/afun.m";

   int retval;
   struct stat statbuf;
   for (int i = 0; i < LOOPMAX; i++)
     {
        retval = stat (path.c_str (), &statbuf); 
//        cout << retval << "\n";
     }
}


Compiling and using "time ./stat_bm" shows an average running time of 11.8 (5
replicates).

Test code for access in access_bm.cpp:


//#include <iostream>
#include <string>
#include <unistd.h>

using namespace std;

int main()
{
   const int LOOPMAX = 1e7;
   const string path = "/home/rik/wip/Projects_Mine/octave-dev/afun.m";

   int retval;
   for (int i = 0; i < LOOPMAX; i++)
     {
        retval = access (path.c_str (), F_OK); 
//        cout << retval << "\n";
     }
}



Same timing procedure yielded an average running time of 12.8.



(file #48586, file #48587)
    _______________________________________________________

Additional Item Attachment:

File name: stat_bm.cpp                    Size:0 KB
    <https://savannah.gnu.org/file/stat_bm.cpp?file_id=48586>

File name: access_bm.cpp                  Size:0 KB
    <https://savannah.gnu.org/file/access_bm.cpp?file_id=48587>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57439>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]