Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
57640f5c
Kaydet (Commit)
57640f5c
authored
May 26, 2006
tarafından
Fredrik Lundh
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
needforspeed: added PY_LOCAL_AGGRESSIVE macro to enable "aggressive"
LOCAL inlining; also added some missing whitespace
üst
567a8ffd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
15 deletions
+31
-15
pyport.h
Include/pyport.h
+8
-0
ceval.c
Python/ceval.c
+23
-15
No files found.
Include/pyport.h
Dosyayı görüntüle @
57640f5c
...
@@ -141,6 +141,10 @@ typedef Py_intptr_t Py_ssize_t;
...
@@ -141,6 +141,10 @@ typedef Py_intptr_t Py_ssize_t;
* convention for functions that are local to a given module. It also enables
* convention for functions that are local to a given module. It also enables
* inlining, where suitable.
* inlining, where suitable.
*
*
* If PY_LOCAL_AGGRESSIVE is defined before python.h is included, a more
* "aggressive" inlining is enabled. This may lead to code bloat, and may
* slow things down for those reasons. Use with care.
*
* NOTE: You can only use this for functions that are entirely local to a
* NOTE: You can only use this for functions that are entirely local to a
* module; functions that are exported via method tables, callbacks, etc,
* module; functions that are exported via method tables, callbacks, etc,
* should keep using static.
* should keep using static.
...
@@ -149,6 +153,10 @@ typedef Py_intptr_t Py_ssize_t;
...
@@ -149,6 +153,10 @@ typedef Py_intptr_t Py_ssize_t;
#undef USE_INLINE
/* XXX - set via configure? */
#undef USE_INLINE
/* XXX - set via configure? */
#if defined(_MSC_VER)
#if defined(_MSC_VER)
#if defined(PY_LOCAL_AGGRESSIVE)
/* enable more aggressive optimization for visual studio */
#pragma optimize("agtw", on)
#endif
/* ignore warnings if the compiler decides not to inline a function */
/* ignore warnings if the compiler decides not to inline a function */
#pragma warning(disable: 4710)
#pragma warning(disable: 4710)
/* fastest possible local call under MSVC */
/* fastest possible local call under MSVC */
...
...
Python/ceval.c
Dosyayı görüntüle @
57640f5c
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
XXX document it!
XXX document it!
*/
*/
/* enable more aggressive local inlining (platform dependent) */
#define PY_LOCAL_AGGRESSIVE
#include "Python.h"
#include "Python.h"
#include "code.h"
#include "code.h"
...
@@ -16,6 +19,11 @@
...
@@ -16,6 +19,11 @@
#include <ctype.h>
#include <ctype.h>
#if defined(_MSC_VER)
/* enable more aggressive optimization for visual studio */
#pragma optimize("agtw", on)
#endif
#ifndef WITH_TSC
#ifndef WITH_TSC
#define READ_TIMESTAMP(var)
#define READ_TIMESTAMP(var)
...
@@ -83,16 +91,16 @@ typedef PyObject *(*callproc)(PyObject *, PyObject *, PyObject *);
...
@@ -83,16 +91,16 @@ typedef PyObject *(*callproc)(PyObject *, PyObject *, PyObject *);
/* Forward declarations */
/* Forward declarations */
#ifdef WITH_TSC
#ifdef WITH_TSC
Py_LOCAL
(
PyObject
*
)
call_function
(
PyObject
***
,
int
,
uint64
*
,
uint64
*
);
Py_LOCAL
(
PyObject
*
)
call_function
(
PyObject
***
,
int
,
uint64
*
,
uint64
*
);
#else
#else
Py_LOCAL
(
PyObject
*
)
call_function
(
PyObject
***
,
int
);
Py_LOCAL
(
PyObject
*
)
call_function
(
PyObject
***
,
int
);
#endif
#endif
Py_LOCAL
(
PyObject
*
)
fast_function
(
PyObject
*
,
PyObject
***
,
int
,
int
,
int
);
Py_LOCAL
(
PyObject
*
)
fast_function
(
PyObject
*
,
PyObject
***
,
int
,
int
,
int
);
Py_LOCAL
(
PyObject
*
)
do_call
(
PyObject
*
,
PyObject
***
,
int
,
int
);
Py_LOCAL
(
PyObject
*
)
do_call
(
PyObject
*
,
PyObject
***
,
int
,
int
);
Py_LOCAL
(
PyObject
*
)
ext_do_call
(
PyObject
*
,
PyObject
***
,
int
,
int
,
int
);
Py_LOCAL
(
PyObject
*
)
ext_do_call
(
PyObject
*
,
PyObject
***
,
int
,
int
,
int
);
Py_LOCAL
(
PyObject
*
)
update_keyword_args
(
PyObject
*
,
int
,
PyObject
***
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
update_keyword_args
(
PyObject
*
,
int
,
PyObject
***
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
update_star_args
(
int
,
int
,
PyObject
*
,
PyObject
***
);
Py_LOCAL
(
PyObject
*
)
update_star_args
(
int
,
int
,
PyObject
*
,
PyObject
***
);
Py_LOCAL
(
PyObject
*
)
load_args
(
PyObject
***
,
int
);
Py_LOCAL
(
PyObject
*
)
load_args
(
PyObject
***
,
int
);
#define CALL_FLAG_VAR 1
#define CALL_FLAG_VAR 1
#define CALL_FLAG_KW 2
#define CALL_FLAG_KW 2
...
@@ -108,19 +116,19 @@ Py_LOCAL(void) call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *);
...
@@ -108,19 +116,19 @@ Py_LOCAL(void) call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *);
Py_LOCAL
(
int
)
maybe_call_line_trace
(
Py_tracefunc
,
PyObject
*
,
Py_LOCAL
(
int
)
maybe_call_line_trace
(
Py_tracefunc
,
PyObject
*
,
PyFrameObject
*
,
int
*
,
int
*
,
int
*
);
PyFrameObject
*
,
int
*
,
int
*
,
int
*
);
Py_LOCAL
(
PyObject
*
)
apply_slice
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
apply_slice
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
int
)
assign_slice
(
PyObject
*
,
PyObject
*
,
Py_LOCAL
(
int
)
assign_slice
(
PyObject
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
);
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
cmp_outcome
(
int
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
cmp_outcome
(
int
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
import_from
(
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
import_from
(
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
int
)
import_all_from
(
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
int
)
import_all_from
(
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
build_class
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
build_class
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
int
)
exec_statement
(
PyFrameObject
*
,
Py_LOCAL
(
int
)
exec_statement
(
PyFrameObject
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
);
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
void
)
set_exc_info
(
PyThreadState
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
void
)
set_exc_info
(
PyThreadState
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
void
)
reset_exc_info
(
PyThreadState
*
);
Py_LOCAL
(
void
)
reset_exc_info
(
PyThreadState
*
);
Py_LOCAL
(
void
)
format_exc_check_arg
(
PyObject
*
,
char
*
,
PyObject
*
);
Py_LOCAL
(
void
)
format_exc_check_arg
(
PyObject
*
,
char
*
,
PyObject
*
);
Py_LOCAL
(
PyObject
*
)
string_concatenate
(
PyObject
*
,
PyObject
*
,
Py_LOCAL
(
PyObject
*
)
string_concatenate
(
PyObject
*
,
PyObject
*
,
PyFrameObject
*
,
unsigned
char
*
);
PyFrameObject
*
,
unsigned
char
*
);
#define NAME_ERROR_MSG \
#define NAME_ERROR_MSG \
...
@@ -476,7 +484,7 @@ enum why_code {
...
@@ -476,7 +484,7 @@ enum why_code {
WHY_YIELD
=
0x0040
/* 'yield' operator */
WHY_YIELD
=
0x0040
/* 'yield' operator */
};
};
static
enum
why_code
do_raise
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
enum
why_code
)
do_raise
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
Py_LOCAL
(
int
)
unpack_iterable
(
PyObject
*
,
int
,
PyObject
**
);
Py_LOCAL
(
int
)
unpack_iterable
(
PyObject
*
,
int
,
PyObject
**
);
/* for manipulating the thread switch and periodic "stuff" - used to be
/* for manipulating the thread switch and periodic "stuff" - used to be
...
@@ -2971,7 +2979,7 @@ reset_exc_info(PyThreadState *tstate)
...
@@ -2971,7 +2979,7 @@ reset_exc_info(PyThreadState *tstate)
/* Logic for the raise statement (too complicated for inlining).
/* Logic for the raise statement (too complicated for inlining).
This *consumes* a reference count to each of its arguments. */
This *consumes* a reference count to each of its arguments. */
static
enum
why_code
Py_LOCAL
(
enum
why_code
)
do_raise
(
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
tb
)
do_raise
(
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
tb
)
{
{
if
(
type
==
NULL
)
{
if
(
type
==
NULL
)
{
...
...
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