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
5d4cb548
Unverified
Kaydet (Commit)
5d4cb548
authored
Tem 18, 2018
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Tem 18, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34141: Optimized pickling simple non-recursive values. (GH-8318)
üst
feabae96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
20 deletions
+17
-20
2018-07-18-08-36-58.bpo-34141.Fo7Q5r.rst
...ore and Builtins/2018-07-18-08-36-58.bpo-34141.Fo7Q5r.rst
+1
-0
_pickle.c
Modules/_pickle.c
+16
-20
No files found.
Misc/NEWS.d/next/Core and Builtins/2018-07-18-08-36-58.bpo-34141.Fo7Q5r.rst
0 → 100644
Dosyayı görüntüle @
5d4cb548
Optimized pickling atomic types (None, bool, int, float, bytes, str).
Modules/_pickle.c
Dosyayı görüntüle @
5d4cb548
...
@@ -3940,9 +3940,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
...
@@ -3940,9 +3940,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
if
(
_Pickler_OpcodeBoundary
(
self
)
<
0
)
if
(
_Pickler_OpcodeBoundary
(
self
)
<
0
)
return
-
1
;
return
-
1
;
if
(
Py_EnterRecursiveCall
(
" while pickling an object"
))
return
-
1
;
/* The extra pers_save argument is necessary to avoid calling save_pers()
/* The extra pers_save argument is necessary to avoid calling save_pers()
on its returned object. */
on its returned object. */
if
(
!
pers_save
&&
self
->
pers_func
)
{
if
(
!
pers_save
&&
self
->
pers_func
)
{
...
@@ -3952,7 +3949,7 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
...
@@ -3952,7 +3949,7 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
1 if a persistent id was saved.
1 if a persistent id was saved.
*/
*/
if
((
status
=
save_pers
(
self
,
obj
))
!=
0
)
if
((
status
=
save_pers
(
self
,
obj
))
!=
0
)
goto
done
;
return
status
;
}
}
type
=
Py_TYPE
(
obj
);
type
=
Py_TYPE
(
obj
);
...
@@ -3965,40 +3962,39 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
...
@@ -3965,40 +3962,39 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
/* Atom types; these aren't memoized, so don't check the memo. */
/* Atom types; these aren't memoized, so don't check the memo. */
if
(
obj
==
Py_None
)
{
if
(
obj
==
Py_None
)
{
status
=
save_none
(
self
,
obj
);
return
save_none
(
self
,
obj
);
goto
done
;
}
}
else
if
(
obj
==
Py_False
||
obj
==
Py_True
)
{
else
if
(
obj
==
Py_False
||
obj
==
Py_True
)
{
status
=
save_bool
(
self
,
obj
);
return
save_bool
(
self
,
obj
);
goto
done
;
}
}
else
if
(
type
==
&
PyLong_Type
)
{
else
if
(
type
==
&
PyLong_Type
)
{
status
=
save_long
(
self
,
obj
);
return
save_long
(
self
,
obj
);
goto
done
;
}
}
else
if
(
type
==
&
PyFloat_Type
)
{
else
if
(
type
==
&
PyFloat_Type
)
{
status
=
save_float
(
self
,
obj
);
return
save_float
(
self
,
obj
);
goto
done
;
}
}
/* Check the memo to see if it has the object. If so, generate
/* Check the memo to see if it has the object. If so, generate
a GET (or BINGET) opcode, instead of pickling the object
a GET (or BINGET) opcode, instead of pickling the object
once again. */
once again. */
if
(
PyMemoTable_Get
(
self
->
memo
,
obj
))
{
if
(
PyMemoTable_Get
(
self
->
memo
,
obj
))
{
if
(
memo_get
(
self
,
obj
)
<
0
)
return
memo_get
(
self
,
obj
);
goto
error
;
goto
done
;
}
}
if
(
type
==
&
PyBytes_Type
)
{
if
(
type
==
&
PyBytes_Type
)
{
status
=
save_bytes
(
self
,
obj
);
return
save_bytes
(
self
,
obj
);
goto
done
;
}
}
else
if
(
type
==
&
PyUnicode_Type
)
{
else
if
(
type
==
&
PyUnicode_Type
)
{
status
=
save_unicode
(
self
,
obj
);
return
save_unicode
(
self
,
obj
);
goto
done
;
}
}
else
if
(
type
==
&
PyDict_Type
)
{
/* We're only calling Py_EnterRecursiveCall here so that atomic
types above are pickled faster. */
if
(
Py_EnterRecursiveCall
(
" while pickling an object"
))
{
return
-
1
;
}
if
(
type
==
&
PyDict_Type
)
{
status
=
save_dict
(
self
,
obj
);
status
=
save_dict
(
self
,
obj
);
goto
done
;
goto
done
;
}
}
...
...
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