Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
88eedd39
Commit
88eedd39
authored
Jun 26, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #650 from kmod/perf7
Switch BoxedMethodDescriptor to tpp_call
parents
a9813b80
d9a11db2
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
106 additions
and
99 deletions
+106
-99
microbenchmarks/itertools_chain_bench.py
microbenchmarks/itertools_chain_bench.py
+2
-1
src/core/stats.cpp
src/core/stats.cpp
+1
-0
src/core/stats.h
src/core/stats.h
+16
-1
src/runtime/cxx_unwind.cpp
src/runtime/cxx_unwind.cpp
+10
-0
src/runtime/descr.cpp
src/runtime/descr.cpp
+75
-95
src/runtime/types.h
src/runtime/types.h
+2
-2
No files found.
microbenchmarks/itertools_chain_bench.py
View file @
88eedd39
...
@@ -7,7 +7,8 @@ def f(c):
...
@@ -7,7 +7,8 @@ def f(c):
pass
pass
l
=
[]
l
=
[]
r
=
range
(
500
)
for
i
in
xrange
(
100
):
for
i
in
xrange
(
100
):
l
.
append
(
itertools
.
chain
(
*
[
r
ange
(
500
)
for
j
in
xrange
(
500
)
]))
l
.
append
(
itertools
.
chain
(
*
[
r
for
j
in
r
]))
c
=
itertools
.
chain
(
*
l
)
c
=
itertools
.
chain
(
*
l
)
f
(
c
)
f
(
c
)
src/core/stats.cpp
View file @
88eedd39
...
@@ -25,6 +25,7 @@ namespace pyston {
...
@@ -25,6 +25,7 @@ namespace pyston {
#if STAT_TIMERS
#if STAT_TIMERS
__thread
StatTimer
*
StatTimer
::
stack
;
__thread
StatTimer
*
StatTimer
::
stack
;
__thread
uint64_t
*
StatTimer
::
counter_override
;
StatTimer
*
StatTimer
::
swapStack
(
StatTimer
*
s
)
{
StatTimer
*
StatTimer
::
swapStack
(
StatTimer
*
s
)
{
uint64_t
at_time
=
getCPUTicks
();
uint64_t
at_time
=
getCPUTicks
();
...
...
src/core/stats.h
View file @
88eedd39
...
@@ -129,10 +129,22 @@ private:
...
@@ -129,10 +129,22 @@ private:
int
avoidability
;
int
avoidability
;
bool
reset_avoidability
;
bool
reset_avoidability
;
static
__thread
uint64_t
*
counter_override
;
public:
public:
StatTimer
(
uint64_t
*
counter
,
int
avoidability
,
bool
reset_avoidability
=
false
)
StatTimer
(
uint64_t
*
counter
,
int
avoidability
,
bool
reset_avoidability
=
false
)
:
_statcounter
(
counter
),
avoidability
(
avoidability
),
reset_avoidability
(
reset_avoidability
)
{}
:
_statcounter
(
counter
),
avoidability
(
avoidability
),
reset_avoidability
(
reset_avoidability
)
{}
static
void
overrideCounter
(
uint64_t
*
new_counter
)
{
assert
(
!
counter_override
);
counter_override
=
new_counter
;
}
static
void
finishOverride
()
{
assert
(
counter_override
);
counter_override
=
NULL
;
}
void
pushNonTopLevel
()
{
void
pushNonTopLevel
()
{
#ifndef NDEBUG
#ifndef NDEBUG
_start_time
=
0
;
_start_time
=
0
;
...
@@ -187,6 +199,9 @@ private:
...
@@ -187,6 +199,9 @@ private:
assert
(
at_time
>
_start_time
);
assert
(
at_time
>
_start_time
);
uint64_t
_duration
=
at_time
-
_start_time
;
uint64_t
_duration
=
at_time
-
_start_time
;
if
(
counter_override
)
Stats
::
log
(
counter_override
,
_duration
);
else
Stats
::
log
(
_statcounter
,
_duration
);
Stats
::
log
(
_statcounter
,
_duration
);
_start_time
=
0
;
_start_time
=
0
;
...
...
src/runtime/cxx_unwind.cpp
View file @
88eedd39
...
@@ -561,6 +561,9 @@ static inline void unwind_loop(ExcInfo* exc_data) {
...
@@ -561,6 +561,9 @@ static inline void unwind_loop(ExcInfo* exc_data) {
// we're transfering control to a non-cleanup landing pad.
// we're transfering control to a non-cleanup landing pad.
// i.e. a catch block. thus ends our unwind session.
// i.e. a catch block. thus ends our unwind session.
endPythonUnwindSession
(
unwind_session
);
endPythonUnwindSession
(
unwind_session
);
#if STAT_TIMERS
pyston
::
StatTimer
::
finishOverride
();
#endif
}
}
static_assert
(
THREADING_USE_GIL
,
"have to make the unwind session usage in this file thread safe!"
);
static_assert
(
THREADING_USE_GIL
,
"have to make the unwind session usage in this file thread safe!"
);
// there is a python unwinding implementation detail leaked
// there is a python unwinding implementation detail leaked
...
@@ -660,6 +663,10 @@ extern "C" void __cxa_end_catch() {
...
@@ -660,6 +663,10 @@ extern "C" void __cxa_end_catch() {
#define EXCINFO_TYPE_INFO _ZTIN6pyston7ExcInfoE
#define EXCINFO_TYPE_INFO _ZTIN6pyston7ExcInfoE
extern
"C"
std
::
type_info
EXCINFO_TYPE_INFO
;
extern
"C"
std
::
type_info
EXCINFO_TYPE_INFO
;
#if STAT_TIMERS
static
uint64_t
*
unwinding_stattimer
=
pyston
::
Stats
::
getStatCounter
(
"us_timer_unwinding"
);
#endif
extern
"C"
void
__cxa_throw
(
void
*
exc_obj
,
std
::
type_info
*
tinfo
,
void
(
*
dtor
)(
void
*
))
{
extern
"C"
void
__cxa_throw
(
void
*
exc_obj
,
std
::
type_info
*
tinfo
,
void
(
*
dtor
)(
void
*
))
{
assert
(
!
pyston
::
in_cleanup_code
);
assert
(
!
pyston
::
in_cleanup_code
);
assert
(
exc_obj
);
assert
(
exc_obj
);
...
@@ -671,6 +678,9 @@ extern "C" void __cxa_throw(void* exc_obj, std::type_info* tinfo, void (*dtor)(v
...
@@ -671,6 +678,9 @@ extern "C" void __cxa_throw(void* exc_obj, std::type_info* tinfo, void (*dtor)(v
pyston
::
ExcInfo
*
exc_data
=
(
pyston
::
ExcInfo
*
)
exc_obj
;
pyston
::
ExcInfo
*
exc_data
=
(
pyston
::
ExcInfo
*
)
exc_obj
;
checkExcInfo
(
exc_data
);
checkExcInfo
(
exc_data
);
#if STAT_TIMERS
pyston
::
StatTimer
::
overrideCounter
(
unwinding_stattimer
);
#endif
// let unwinding.cpp know we've started unwinding
// let unwinding.cpp know we've started unwinding
pyston
::
throwingException
(
pyston
::
getActivePythonUnwindSession
());
pyston
::
throwingException
(
pyston
::
getActivePythonUnwindSession
());
pyston
::
unwind
(
exc_data
);
pyston
::
unwind
(
exc_data
);
...
...
src/runtime/descr.cpp
View file @
88eedd39
This diff is collapsed.
Click to expand it.
src/runtime/types.h
View file @
88eedd39
...
@@ -927,8 +927,8 @@ public:
...
@@ -927,8 +927,8 @@ public:
static
Box
*
__get__
(
BoxedMethodDescriptor
*
self
,
Box
*
inst
,
Box
*
owner
);
static
Box
*
__get__
(
BoxedMethodDescriptor
*
self
,
Box
*
inst
,
Box
*
owner
);
static
Box
*
__call__
(
BoxedMethodDescriptor
*
self
,
Box
*
obj
,
BoxedTuple
*
varargs
,
Box
**
_args
);
static
Box
*
__call__
(
BoxedMethodDescriptor
*
self
,
Box
*
obj
,
BoxedTuple
*
varargs
,
Box
**
_args
);
static
Box
*
callInternal
(
BoxedFunctionBase
*
f
,
CallRewriteArgs
*
rewrite_args
,
ArgPassSpec
argspec
,
Box
*
arg1
,
static
Box
*
tppCall
(
Box
*
_self
,
CallRewriteArgs
*
rewrite_args
,
ArgPassSpec
argspec
,
Box
*
arg1
,
Box
*
arg2
,
Box
*
arg3
,
Box
*
arg2
,
Box
*
arg3
,
Box
**
args
,
const
std
::
vector
<
BoxedString
*>*
keyword_names
);
Box
**
args
,
const
std
::
vector
<
BoxedString
*>*
keyword_names
);
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
_o
);
static
void
gcHandler
(
GCVisitor
*
v
,
Box
*
_o
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment