is it faster to have a C++ code where you write boost.python mostly than to have Python code with the same?
Like
Syntax: Select all
import os
if __name__ == "__main__":
x = [3, 6, 7, 9]
z = os.getcwd()
# do something else like reading a file and display its contents to the screen
Syntax: Select all
#include <stdlib.h> // for getcwd()
#include <boost/python.hpp>
using namespace boost::python;
BOOST_PYTHON_MODULE(test) // or whatever you write the main thing in...
{
char path[1024];
list<int> x({4, 6, 7, 8}); // or however you initialize a list object directly, you know what I mean
getcwd(path, 1024);
str z(path);
// do something else like reading a file and display its contents to the screen
}
I wanna know if it makes a speed difference to have actually the same code in a C++ library.