[issue46971] python takes long time when return big data

2022-03-11 Thread Mark Dickinson


Mark Dickinson  added the comment:

> why it costs lots of time when del a large array?

That's probably a question for the NumPy folks, or possibly for Stack Overflow 
or some other question-and-answer resource. It'll depend on how NumPy arrays 
are de-allocated.

> Is there any way to process del in parallel?

Seems unlikely, given GIL constraints.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46971] python takes long time when return big data

2022-03-10 Thread Hu Di


Hu Di <476658...@qq.com> added the comment:

I am currently processing large data, and the time spent by del is 
unacceptable. Is there any way to process del in parallel?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46971] python takes long time when return big data

2022-03-10 Thread Hu Di


Hu Di <476658...@qq.com> added the comment:

thanks for your explaining, by the way, why it costs lots of time when del  
 a large array?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46971] python takes long time when return big data

2022-03-10 Thread Mark Dickinson


Mark Dickinson  added the comment:

This is expected. Your timing measures the time for garbage collection of the 
large arrays in addition to the time for the result to be returned.

In the line `result = myfunc()`, the name `result` gets rebound to the value of 
`myfunc()`. That means that `result` is unbound from whatever it was previously 
bound to, and the old value then gets garbage collected.

You can test this by adding a "del result" line as the last line inside the 
"for" loop block.

--
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46971] python takes long time when return big data

2022-03-10 Thread Hu Di


New submission from Hu Di <476658...@qq.com>:

it takes a long time when python return big data.
generally, when a function return something, it only take less than 1e-5 second,
but when the result is big, like np.random.rand(2048,3,224,224), the time cost 
will increase to 0.1-0.2 second

--
Added file: https://bugs.python.org/file50665/python_performance_issue.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46971] python takes long time when return big data

2022-03-10 Thread Hu Di


Change by Hu Di <476658...@qq.com>:


--
components: Interpreter Core
nosy: HumberMe
priority: normal
severity: normal
status: open
title: python takes long time when return big data
type: performance
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com