mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 12:30:19 +00:00
Create profile.sh
up
This commit is contained in:
parent
b836a6be84
commit
fda2338c9f
7
profile.sh
Normal file
7
profile.sh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
g++ -o pocketpy src/main.cpp --std=c++17 -pg -O1 -fno-rtti
|
||||||
|
|
||||||
|
./pocketpy benchmarks/simple.py
|
||||||
|
|
||||||
|
gprof pocketpy gmon.out > gprof.txt
|
||||||
|
|
||||||
|
rm gmon.out
|
@ -109,7 +109,7 @@ struct CodeObject {
|
|||||||
/************************************************/
|
/************************************************/
|
||||||
};
|
};
|
||||||
|
|
||||||
static thread_local i64 kFrameGlobalId = 0;
|
static THREAD_LOCAL i64 kFrameGlobalId = 0;
|
||||||
|
|
||||||
struct Frame {
|
struct Frame {
|
||||||
std::vector<PyVar> _data;
|
std::vector<PyVar> _data;
|
||||||
|
@ -56,4 +56,7 @@ template<typename T>
|
|||||||
void* tid() {
|
void* tid() {
|
||||||
static volatile int8_t _x;
|
static volatile int8_t _x;
|
||||||
return (void*)(&_x);
|
return (void*)(&_x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//#define THREAD_LOCAL thread_local
|
||||||
|
#define THREAD_LOCAL
|
@ -149,7 +149,7 @@ namespace pkpy {
|
|||||||
};
|
};
|
||||||
|
|
||||||
constexpr int kMemObjSize = sizeof(int) + sizeof(Py_<i64>);
|
constexpr int kMemObjSize = sizeof(int) + sizeof(Py_<i64>);
|
||||||
static thread_local MemBlock<kMemObjSize> _mem_pool(512);
|
static THREAD_LOCAL MemBlock<kMemObjSize> _mem_pool(512);
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct SpAllocator<PyObject> {
|
struct SpAllocator<PyObject> {
|
||||||
|
@ -39,7 +39,7 @@ typedef emhash8::HashMap<Str, PyVar> NameDict;
|
|||||||
|
|
||||||
namespace pkpy {
|
namespace pkpy {
|
||||||
const int kMaxPoolSize = 10;
|
const int kMaxPoolSize = 10;
|
||||||
static thread_local std::vector<PyVar*>* _args_pool = new std::vector<PyVar*>[kMaxPoolSize];
|
static THREAD_LOCAL std::vector<PyVar*>* _args_pool = new std::vector<PyVar*>[kMaxPoolSize];
|
||||||
|
|
||||||
class Args {
|
class Args {
|
||||||
PyVar* _args;
|
PyVar* _args;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user