<div dir="ltr">were equipped of course, hem!<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 3 mai 2020 à 17:22, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>bah excuse the grammar...</div><div>I constantly invert now vs know and where vs were, I wish your brain is equipped with auto-correction.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 3 mai 2020 à 17:20, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 3 mai 2020 à 17:13, Tobias Pape <<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
> On 03.05.2020, at 15:52, Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
> <br>
> Hi Subbu,<br>
> Yes those raw bits are somehow like immediates, but not exactly...<br>
<br>
So the name maybe should include "raw"?<br>
:D<br>
-t<br></blockquote><div><br></div><div>Yes, that was the first name that came in my mind.</div><div>From the abstract superclass POV, those are raw bits.</div><div>Only subclass really now how to interpret those bits as value objects.</div><div>I don't know why I then changed my mind...</div><div>Maybe because RawBits does not convey the meaning of FixedWidth.</div><div>Note that the class query is #isBits. So the AbstractBitsArray is somehow in line with that.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> Immediates are objects having their value encoded into the pointer slot (either in 4 or 8 bytes, according to 32bits or 64bits VM word size).<br>
> Currently, this covers only SmallInteger, Character and SmallFloat on 64bits.<br>
> <br>
> Here we have values encoded into slots of 1, 2, 4 or 8 bytes, but not into an object oriented pointer slot.<br>
> Technically, #(1 2.0 $3) is an Array of immediates, while ((ColorArray with: Color black) first) is not an immediate...<br>
> So even if it is the same notion of encoded value, it's not an exact match...<br>
> <br>
> Concerning the use cases, I effectively want to use such bit arrays for fast data transfer.<br>
> For example, it is useful for FFI I use exclusivily this kind of array for Smallapack...<br>
> But also when reading big files in Matlab, National Instrument TDMS or HDF5 format.<br>
> it really helps to have all the possible flavours for common elementary types of values.<br>
> Otherwise, I have to use an intermediate ByteArray, or pointers to external heap via FFI (like I did in Smallapack).<br>
> <br>
> More than often, the data transfer can handle offset and stride via a BitBlt tricks (unless we have an odd layout).<br>
> This enables extracting a single "column" or bloc of data from a big file with a single copy.<br>
> I may need to extend BitBlt to cope with all the available bit-widths, not just 8 (byte) or 32 (word) though.<br>
> <br>
> Also, those formats offer packed and contiguous memory layout which is an advantage too when dealing with large chunks of data.<br>
> Especially if we have vectorized primitives operating on the arrays.<br>
> <br>
> Also, creating non-immediate objects on the fly thru #at: #at:put: is very efficient if VM has generation scavenger because those objects are generally short-lived.<br>
> While retaining all the pointers to a whole collection of non immediate objects is putting a lot of pressure on the garbage collector.<br>
> <br>
> The advantage somehow diminish with the advent of 64bits VM: most values can be immediates, so we have quasi-contiguous data at a few exceptions, and not so much GC pressure.<br>
> But still, the primitives can operate on raw bits, without having to handle the immediate tag, nor exceptional (non immediate) values.<br>
> <br>
> For the anecdote, in the 90s, I started to experiment some crashes in objectworks/visualworks when handling large Arrays of Float.<br>
> The console would only report: *out of memory*.<br>
> With increasing processor speed, the memory where exhausted before the low space monitoring process had a chance to handle the situation.<br>
> I then decided to handle all my Arrays of Float (Double) thru some UninterpretedBytes and ad-hoc primitives for at: at:put:<br>
> Since then, I never came back to pointer oriented arrays: if we want Smalltalk to scale, we need those basic objects  :)<br>
> <br>
> <br>
> Le dim. 3 mai 2020 à 06:50, K K Subbu <<a href="mailto:kksubbu.ml@gmail.com" target="_blank">kksubbu.ml@gmail.com</a>> a écrit :<br>
> On 02/05/20 5:41 pm, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
> > Nicolas Cellier uploaded a new version of Collections to project The Inbox:<br>
> > <a href="http://source.squeak.org/inbox/Collections-nice.891.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-nice.891.mcz</a><br>
> > <br>
> > ==================== Summary ====================<br>
> > <br>
> > Name: Collections-nice.891<br>
> > Author: nice<br>
> > Time: 2 May 2020, 7:40:45.298967 pm<br>
> > UUID: 08510be0-8293-6744-959d-c1d41bc13ae1<br>
> > Ancestors: Collections-nice.890<br>
> > <br>
> > Experimental - For discussion<br>
> > <br>
> > Group some (most) non-pointers collections under an abstract FixedBitWifthArray.<br>
> > I know, the name is hard to pronounce and thus ugly: it's opened to discussion.<br>
> > <br>
> > This enables factorization of some methods, for example the trick for atAllPut:<br>
> > Also notice that most methods are shared between FloatArray and Float64Array.<br>
> <br>
> How about ImmediateWord/ImmediateObject and an ImmediateArray (an array <br>
> consisting only of Immediate elements)? It would be consistent with <br>
> isImmediateClass method.<br>
> <br>
> An object chunk could be checked at loading time to see if it needs to <br>
> be converted from immediate to pointers or vice versa. In the typical <br>
> case, this will be a nop. But if the image is moved to a different host <br>
> type (say from 64b to 32b or from x86 to ARM), then some immediate <br>
> numbers may be converted into pointers or vice versa. If this increases <br>
> loading time for large images, then the image may be saved locally.<br>
> <br>
> This is just a strawman. I haven't really thought through all its <br>
> implications.<br>
> <br>
> Regards .. Subbu<br>
> <br>
> <br>
<br>
<br>
<br>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>