[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Wenjun Huang
Hi Guido, I guess I didn't think it through. Thanks for all your comments! Regards On Mon, Jul 20, 2020 at 10:35 PM Guido van Rossum wrote: > Wenjun, > > I feel we're just not communicating. Your suggestion seems to be a > solution in search of a problem. And now you're making more super >

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Guido van Rossum
Wenjun, I feel we're just not communicating. Your suggestion seems to be a solution in search of a problem. And now you're making more super speculative suggestions. How much do you actually know about Python's internals? It's not at all like C++, where I could see the distinction between user

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Wenjun Huang
Hi Guido, Thank you for bearing with me. I wasn't trying to say you guys are mean btw. I thought that the interpreter might allocate some memory for its own use. Perhaps I was wrong, but I'll work with your examples here just to be sure. Stack frames would be considered as interpreter objects

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Guido van Rossum
On Mon, Jul 20, 2020 at 4:09 PM Wenjun Huang wrote: > Hi Barry, > > It's not just about leaks. You might want to know if certain objects are > occupying a lot of memory by themselves. Then you can optimize the memory > usage of these objects. > > Another possibility is to do binary

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Wenjun Huang
Hi Barry, It's not just about leaks. You might want to know if certain objects are occupying a lot of memory by themselves. Then you can optimize the memory usage of these objects. Another possibility is to do binary instrumentation and see how the user code is interacting with objects. If we

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Barry
> On 20 Jul 2020, at 18:51, Wenjun Huang wrote: > >  > Hi Guido, > > It's great to hear from you directly :) > > Sorry for not mentioning this earlier. The use case here is profiling. > Specifically, Scalene: https://github.com/emeryberger/scalene. > > At the moment, Scalene does stack

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Wenjun Huang
Hi Guido, It's great to hear from you directly :) Sorry for not mentioning this earlier. The use case here is profiling. Specifically, Scalene: https://github.com/emeryberger/scalene. At the moment, Scalene does stack inspection to decide if an allocation is from the user. If there are hooks

[Python-ideas] Re: isolating user allocations

2020-07-19 Thread Guido van Rossum
What purpose do you have in mind for making this distinction? Even if it could be done easily (which I doubt), why would this be useful? On Sun, Jul 19, 2020 at 19:01 wrote: > Hello, > > The API provided by PEP 445 makes it possible to intercept allocation > requests through hooks, but it seems