From: Jeff A. <ja...@fa...> - 2016-07-19 20:01:01
|
Thanks Stefan: nothing obviously crazy about the concept then. I'll take others' advice (Jim?) on whether this kind of change is too much for 2.7.1, or feels safe. Concerning loops with calls in them, there's always an implementation like that near the base of the hierarchy so that the non-contiguous case is catered for, then the option (which I like to take up) of using a bulk method in the contiguous sub-class. If we suddenly wanted to support CopyTo/From ByteBuffer in the API, implementing it efficiently could follow along. Main thing is you have your buffer protocol interface onto non-heap storage to try when you can. Jeff Jeff Allen On 17/07/2016 15:26, Stefan Richthofer wrote: > Hello Jeff, > > sorry for the delay. I was (and still am) busy with adding NumPy support and it turned out that NumPy is okay with PyMemoryView_FromObject returning null for now (I suppose it has a fallback for that). It actually does call that method which is why I thought buffer protocol (which PyMemoryView_FromObject is based on) would be an urgent need for NumPy support. Of course I still want to add buffer protocol to JyNI, but won't find time to look at this before NumPy support moved on some more. So I did not yet take a detailed look at your work. However my main concern there would be to avoid that any index-iterating (NIO-bridge-)method would perform method calls within a loop, but instead is implemented using bulk-access methods. If this is already the case I would most likely have no further concerns. > Thanks for adding getObj(); this is useful in any case. > >> Do you think this would be bloat, nice-to-have, or really useful for what you were hoping to do? > This sounds like it is mainly relevant for Java-integration and not so much for JyNI. Spontaneously I'd give it a "nice to have". > > To give you some definite clue regarding my time-management: I will resume work on BufferProtocol-front after > a) Jython 2.7.1 was released > b) JyNI 2.7-alpha.4 was released. > > > Best, > > Stefan > > >> Gesendet: Freitag, 15. Juli 2016 um 09:42 Uhr >> Von: "Jeff Allen" <ja...@fa...> >> An: "Stefan Richthofer" <Ste...@gm...> >> Cc: "Jython Developers" <jyt...@li...> >> Betreff: Re: [Jython-dev] Jython buffer protocol >> >> Stefan: >> >> I recently pushed more changes to my bitbucket fork, including addition >> of a getObj() to PyBuffer in response to your need to navigate to the >> exporting object. >> >> The existing PyBuffer interface provides copyTo/From byte arrays. With >> support for non-heap NIO storage it seems natural (and not too hard) to >> add copyTo/From ByteBuffer. At present these are in the NIO >> implementation, but not made interface items. Do you think this would be >> bloat, nice-to-have, or really useful for what you were hoping to do? >> >> Jeff >> >> Jeff Allen >> >> On 13/06/2016 01:04, Stefan Richthofer wrote: >>> Hey Jeff, >>> thanks a lot for this work. I will take a closer look as soon as I find time. >>> However, so far - quickly scrolling through some source-files - it looks pretty good. >>> >>> Best >>> >>> Stefan >>> >>> >>> >>>> Gesendet: Samstag, 11. Juni 2016 um 11:37 Uhr >>>> Von: "Jeff Allen" <ja...@fa...> >>>> An: "Stefan Richthofer" <Ste...@gm...> >>>> Cc: "Jython Developers" <jyt...@li...> >>>> Betreff: Re: [Jython-dev] Jython buffer protocol >>>> >>>> Stefan: >>>> >>>> A sane version of the nio buffer work now exists for your delight at: >>>> https://bitbucket.org/tournesol/jython-nio >>>> >> <snip> >> |