On Sat, Feb 28, 2009 at 6:55 PM, Ramon Leon <[hidden email]> wrote:
I need to point out that unless the various communities can start building their disparate and diverging images form a micro-kernel image I don't see how improved execution technology is going to be adopted by the community. I'm working hard on a VM that will be potentially 10x the current Squeak VM for Smalltalk intensive benchmarks. This VM will be source code compatible and bytecode compatible but likely it will not be image compatible as it will use a streamlined object representation that doesn't use compact classes. The only way I can see this being adopted by the community at large is if the community starts building images form microkernels.
I'm sure you can see there are significant benefits in building images form automatically constructed microkernels. - images are no longer tied to obsolete image formats and/or object memory layouts and restrictions (such as a single contiguous heap segment with no support for memory-mapped segments, giving memory back to the OS after GC, pinning objects for the FFI, etc, etc).
- bytecode sets, compilation technology and VM technology can evolve and improve performance as ingenuity permits - platform integration can improve, e.g. allowing Squeak as a DLL If the various forks maintain different basic images instead of different bootstraps (same end-point, different starting-points) then this just isn't practicable and performance won't improve.
So I hope you're wrong and that starting from kernel images isn't a pipe dream. Let me emphasisze I am *not* advocating a common development image, only a common microkernel from which all other images can be built, automatically.
|
On Sat, Feb 28, 2009 at 7:32 PM, Eliot Miranda <[hidden email]> wrote:
> I need to point out that unless the various communities can start building > their disparate and diverging images form a micro-kernel image I don't see > how improved execution technology is going to be adopted by the community. > I'm working hard on a VM that will be potentially 10x the current Squeak VM > for Smalltalk intensive benchmarks. This VM will be source code compatible > and bytecode compatible but likely it will not be image compatible as it > will use a streamlined object representation that doesn't use compact > classes. The only way I can see this being adopted by the community at > large is if the community starts building images form microkernels. I'm not sure that's true. Say it becomes yet another fork, separate (necessarily, at first, because it's a different image format) from all of the other forks. As long as most packages can be loaded into it, it'll get used. Maybe not by the people doing the forking (by Scratch, say, or Squeakland), but by the majority of us who have a few pet packages (in my case, Seaside, OmniBrowser, DabbleDB, etc) that we can load into nearly any Squeak image and feel at home. I'm pretty happy to load those into a MinimalMorphic image this month, a Pharo image next month, and a Cog image the month after, if there's some compelling reason to do so - and 10x performance would certainly be compelling. A shared microkernel would be nice, but I don't think it's essential in the short term to drive adoption of a new technology. |
I'm not sure that's true. Say it becomes yet another fork, separate Ditto, as I said earlier, I care about my packages, not which squeak image is the base, but for a 10x bump in speed, I'd certainly take the time to port everything I use, if only for deployment. Getting everyone on a common kernel would take something really compelling them all to feel the same way, a 10x bump in speed *is certainly* compelling. Ramon Leon http://onsmalltalk.com |
In reply to this post by Klaus D. Witzel
|
On 01.03.2009, at 09:59, stephane ducasse wrote: > Were is the code of microSqueak On John's hard disk. He did it a couple of years ago and showed it to us last summer. As Eliot wrote, it builds an image in memory from a hierarchy of classes. Pretty neat, though probably more a proof of concept than production-ready. - Bert - |
In reply to this post by Avi Bryant-2
2009/3/1 Avi Bryant <[hidden email]>:
> On Sat, Feb 28, 2009 at 7:32 PM, Eliot Miranda <[hidden email]> wrote: > >> I need to point out that unless the various communities can start building >> their disparate and diverging images form a micro-kernel image I don't see >> how improved execution technology is going to be adopted by the community. >> I'm working hard on a VM that will be potentially 10x the current Squeak VM >> for Smalltalk intensive benchmarks. This VM will be source code compatible >> and bytecode compatible but likely it will not be image compatible as it >> will use a streamlined object representation that doesn't use compact >> classes. The only way I can see this being adopted by the community at >> large is if the community starts building images form microkernels. > > I'm not sure that's true. Say it becomes yet another fork, separate > (necessarily, at first, because it's a different image format) from > all of the other forks. As long as most packages can be loaded into > it, it'll get used. Maybe not by the people doing the forking (by > Scratch, say, or Squeakland), but by the majority of us who have a few > pet packages (in my case, Seaside, OmniBrowser, DabbleDB, etc) that we > can load into nearly any Squeak image and feel at home. I'm pretty > happy to load those into a MinimalMorphic image this month, a Pharo > image next month, and a Cog image the month after, if there's some > compelling reason to do so - and 10x performance would certainly be > compelling. > > A shared microkernel would be nice, but I don't think it's essential > in the short term to drive adoption of a new technology. > It is essential in a terms of allowing evolution of VM as a regular process, not as a single major blow which done once, then adopted and frozen for the next 10 years (or more). VM having a certain contracts with a language side, like object formats, bytecode set, special objects and their slot positions, core classes etc etc.. If you not follow the VM obligations on this - you can't declare your image/work as a safe, stable environment. And kernel image is the best way to ensure that all such contracts is fullfilled. It serves to identify all such contracts, represent them at language side and make them work. Without kernel image, we doomed to wander in the dark, guessing , what code needs to be changed to adopt new VM capabilities, and also keep VM developers care much more about backward compatibility (often by sacrificing the cool improvements, just because of fear that it will not be compatible). -- Best regards, Igor Stasenko AKA sig. |
In reply to this post by Eliot Miranda-2
Eliot Miranda a écrit :
> I need to point out that unless the various communities can start building > their disparate and diverging images form a micro-kernel image I don't see > how improved execution technology is going to be adopted by the community. > I'm working hard on a VM that will be potentially 10x the current Squeak VM > for Smalltalk intensive benchmarks. This VM will be source code compatible > and bytecode compatible but likely it will not be image compatible as it > will use a streamlined object representation that doesn't use compact > classes. The only way I can see this being adopted by the community at > large is if the community starts building images form microkernels. maybe a silly question (I have no idea of what is involved): would converting an image from the current format to the one your VM will require be an option ? Stef |
2009/3/1 Stéphane Rollandin <[hidden email]>:
> Eliot Miranda a écrit : >> >> I need to point out that unless the various communities can start building >> their disparate and diverging images form a micro-kernel image I don't see >> how improved execution technology is going to be adopted by the community. >> I'm working hard on a VM that will be potentially 10x the current Squeak >> VM >> for Smalltalk intensive benchmarks. This VM will be source code >> compatible >> and bytecode compatible but likely it will not be image compatible as it >> will use a streamlined object representation that doesn't use compact >> classes. The only way I can see this being adopted by the community at >> large is if the community starts building images form microkernels. > > maybe a silly question (I have no idea of what is involved): would > converting an image from the current format to the one your VM will require > be an option ? > Ask yourself, why you doing a lot of cleanup, throwing away obsolete stuff and replacing with better one in Pharo, and why we coudn't do much the same with VM? :) > Stef > > > -- Best regards, Igor Stasenko AKA sig. |
>> maybe a silly question (I have no idea of what is involved): would >> converting an image from the current format to the one your VM will require >> be an option ? >> > converting an object format does not makes objects behave differently , right? > Ask yourself, why you doing a lot of cleanup, throwing away obsolete > stuff and replacing with better one in Pharo, and why we coudn't do > much the same with VM? :) > >> Stef hum.. I guess I don't know what I am talking about. BTW, I am not the Stef working in Pharo, I'm another Stef :) regards, Stef |
2009/3/1 Stéphane Rollandin <[hidden email]>:
> >>> maybe a silly question (I have no idea of what is involved): would >>> converting an image from the current format to the one your VM will >>> require >>> be an option ? >>> >> converting an object format does not makes objects behave differently , >> right? >> Ask yourself, why you doing a lot of cleanup, throwing away obsolete >> stuff and replacing with better one in Pharo, and why we coudn't do >> much the same with VM? :) >> >>> Stef > > > hum.. I guess I don't know what I am talking about. BTW, I am not the Stef > working in Pharo, I'm another Stef :) ah.. sorry :) Changing the object formats alone does not gives any benefits. What is the point in having new format when you keep using old semantic model as before? This is like swapping instance variables order in your class.. Apart from a better aestetical view it gives you nothing :) > > > regards, > > Stef > -- Best regards, Igor Stasenko AKA sig. |
> ah.. sorry :) > Changing the object formats alone does not gives any benefits. What is > the point in having new format when you keep using old semantic model > as before? > This is like swapping instance variables order in your class.. Apart > from a better aestetical view it gives you nothing :) let me reformulate. what I asked really is: will there be some way to have existing images run on the coming Cog VM ? (quoting Eliot Miranda: "this VM will be source code compatible and bytecode compatible but likely it will not be image compatible as it will use a streamlined object representation that doesn't use compact classes") Stef |
In reply to this post by Avi Bryant-2
On 01.03.2009, at 05:02, Avi Bryant wrote:
> On Sat, Feb 28, 2009 at 7:32 PM, Eliot Miranda <[hidden email] > > wrote: > >> I need to point out that unless the various communities can start >> building >> their disparate and diverging images form a micro-kernel image I >> don't see >> how improved execution technology is going to be adopted by the >> community. >> I'm working hard on a VM that will be potentially 10x the current >> Squeak VM >> for Smalltalk intensive benchmarks. This VM will be source code >> compatible >> and bytecode compatible but likely it will not be image compatible >> as it >> will use a streamlined object representation that doesn't use compact >> classes. The only way I can see this being adopted by the >> community at >> large is if the community starts building images form microkernels. > > I'm not sure that's true. Say it becomes yet another fork, separate > (necessarily, at first, because it's a different image format) from > all of the other forks. As long as most packages can be loaded into > it, it'll get used. Maybe not by the people doing the forking (by > Scratch, say, or Squeakland), but by the majority of us who have a few > pet packages (in my case, Seaside, OmniBrowser, DabbleDB, etc) that we > can load into nearly any Squeak image and feel at home. I'm pretty > happy to load those into a MinimalMorphic image this month, a Pharo > image next month, and a Cog image the month after, if there's some > compelling reason to do so - and 10x performance would certainly be > compelling. > > A shared microkernel would be nice, but I don't think it's essential > in the short term to drive adoption of a new technology. Agreed. I'm still looking for ways to get Squeakland Etoys and squeak.org sharing resources as much as possible. We last cross-merged for the 3.8 release, which was a considerable manual effort, but worth it for both sides (etoys got many bug fixes, squeak.org got the m17n/unicode support). After that, some new packages were shared (Rome, DBus, GStreamer), but no reliable process for exchanging bug fixes exists - not because we do not want it, but because it's simply too much effort. I'll support anyone who finds a way around this, a way to share between forks. Matthew's proposal sounds great and doable. I'll advocate starting to use Monticello for Etoys development - it's the only feasible way to share I see currently. Sharing a microkernel image would be nice but I fear too much has changed in the class/metaclass kernel to make that feasible. But perhaps for using Cog, does it really require extensive image-level changes, or couldn't the SystemTracer be used to convert the image format? - Bert - |
In reply to this post by Ramon Leon-5
Le 28/02/09, Ramon Leon <[hidden email]> écrivait :
Agree with all Ramon, Andréas, and Mathew said till now |
In reply to this post by Igor Stasenko
Igor Stasenko wrote:
> Changing the object formats alone does not gives any benefits. What is > the point in having new format when you keep using old semantic model > as before? Speed. That is the only point of the exercise to begin with. > This is like swapping instance variables order in your class.. Apart > from a better aestetical view it gives you nothing :) If swapping ivars in a class would give me a 3x in performance I'd be doing this all day long... Cheers, - Andreas |
In reply to this post by Bert Freudenberg
Bert Freudenberg wrote:
> Sharing a microkernel image would be nice but I fear too much has > changed in the class/metaclass kernel to make that feasible. But > perhaps for using Cog, does it really require extensive image-level > changes, or couldn't the SystemTracer be used to convert the image > format? Actually, I would say that the SystemTracer is interesting exactly when you have extensive image changes that you want to do only once (say for generating the Squeak 5.0 image starting from the 4.3 one). Some smaller changes can be handled by doing the conversion while reading and saving the image. A good example of that in Cog would be the stack pages - you could create them when reading an old image and you can convert all contexts to old style ones (so the stack pages would be empty) before saving the image. A more radical change, like entirely different bytecode encoding, is easier to do just once with the SystemTracer. This has been an interesting thread about what is possible technically as well as socially ("we could do that, but then the forks wouldn't adopt it"). My "Chunky Squeak" proposal (http://wiki.squeak.org/squeak/584) was meant to be an example of the smallest possible change that I felt would be acceptable for everybody. If people are feeling adventurous and would rather a really modular microkernel Squeak, I have worked on that as well as described in my "Neo Smalltalk modules" page (http://wiki.squeak.org/squeak/5637). Any change to the image format is an extremely significant event in the history of Squeak, probably even worse than the 680x0->PowerPC, Mac OS 9->Mac OS X and PowerPC->Intel changes that the Macintosh community had to endure. I don't think it would be a good idea to do it in a series of steps (except in private development images, of course) but instead it would be better to gather all possible changes into a single 4.x->5.0 transition. There are many little things I wouldn't mind seeing changed. I bet Bryce Kampjes would love to have a 0 tag represent SmallIntegers, for example. For SiliconSqueak (hardware implementation of the VM that I am developing) it would be convenient to have tagged floating point numbers, for another example. And I can't say that I am too happy with the very conservative path that 64 bit Squeak ended up taking. If we agree that each sub-community will have its own images and will at most share Monitcello level packages, then none of the above is a big deal. Let each one do what they like best. But I prefer trying for a shared micro-image with as radical solution as possible, though not so radical that we leave behind the community. -- Jecel |
In reply to this post by Stéphane Rollandin
On Sun, Mar 1, 2009 at 3:19 AM, Stéphane Rollandin <[hidden email]> wrote: Eliot Miranda a écrit : One can convert images from one format to another using the SystemTracer. This is a program that from within an image traces all the objects it can find and writes out a new image. But its tricky. The system isn't usable while the thing is running and the system inevitably includes the SystemTracer which one must later strip out if one wants e.g. a minimal deployment image. So the SystemTracer approach isn't great. (It also suffers from an issue explained below).
One can convert images from one format to another using a program that reads an image, transforms it, and writes it, (I'll call this ImageRewriter) but this is tricky. The image may contain user code that has constraints the ImageRewriter isn't aware of. VisualWorks uses the ImageWriter approach to convert 32-bit images to 64bit images. It does succeed in rewriting the base development image but occasionally will fail to produce a working rewrite of some complicated image.
Even then the image that ImageRewriter produces still needs to contain special support and to be saved to be ready for production. One thing the image does for itself on startup is check if the size of the identity hash field has changed (in 64-bit VW images there is a larger id hash than in 32-bit VW images). If the image finds the id hash filed has changed it rehashes all hashed collections except MethodDictionary. The ImageRewriter (and SystemTracer) knows enough to be able to rehash MethodDictionary and IdentityDictionary. But because the default implementation of #hash in Object is to answer identityHash a change in id hash can potentially affect equal-hashed collections, not just id-hashed ones. But to be able to rehash an equal-hashed collection one must be able to evaluate #hash and #= and these are arbitrarily complex and it gets tricky to get either ImageRewriter or SystemTracer to rehash. Note that they have to compute what the hash would be in the new image, not what it evaluates to in the current image Hence it is much easier to have the new image rehash its non-MethodDictionary collections on start-up.
Clarly this is slow enough that one does it once when starting up the output of ImageRewriter, then saves. The saved image then starts up without needng to rehash because the id-hash size won't have changed.
So both SystemTracer and ImageRewriter approaches have significant difficulties when trying to produce images in which things lie the id hash has changed. They also have difficulties if the instruction set, class implementation, block implementation etc etc of the target has changed because it may be difficult to set-up the necessary invariants.
With the micro-kernel approach the real image is produced by loading code into the microkernel. So the image transformers (be they SystemTracer, ImageRewriter or MicroKernelGenerator) only have to function on the known quantity which is the microkernel image, not on an arbitrarily complex development or product image. Great. But if the microkernel image is simple enough then why not generate it directly from a source specification (as John Maloney's MicroSqueak does)? Instead of stripping code form an existing image, as one must do with both SystemTracer and ImageRewriter one produces just what the microkernel needs to contain, and it i exactly reproducible. In any image that tries to prodeuce a microkernel exactly the same microkernel will be produced whereas with the SystemTracer and ImageRewriter approaches what one gets depends on the image one starts with.
So I much prefer the microkernel approach (I didn't used to; enlightenment comes slowly if at all). It is not absolutely necessary but turns out to have significant advantages. The only downside (and I don't even think it is a downside) is needing to build up a development or production image by loading code into the microkernel (I actually think this is a feature :) ).
HTH est Eliot
|
In reply to this post by Andreas.Raab
2009/3/1 Andreas Raab <[hidden email]>:
> Igor Stasenko wrote: >> >> Changing the object formats alone does not gives any benefits. What is >> the point in having new format when you keep using old semantic model >> as before? > > Speed. That is the only point of the exercise to begin with. > >> This is like swapping instance variables order in your class.. Apart >> from a better aestetical view it gives you nothing :) > > If swapping ivars in a class would give me a 3x in performance I'd be doing > this all day long... > unless you change the way how things working, you can't achieve significant performance boost. And often this means rewriting interfaces, which inevitably leads to changing a lot of code on language side etc. > Cheers, > - Andreas > -- Best regards, Igor Stasenko AKA sig. |
On Sun, Mar 1, 2009 at 12:23 PM, Igor Stasenko <[hidden email]> wrote: 2009/3/1 Andreas Raab <[hidden email]>: Uh, no. Here is the inline cache check in Cog, which is as complicated as it is because of compact classes: 00009588: movl %edx, %eax : 89 D0
0000958a: andl $0x00000001, %eax : 83 E0 01 0000958d: jnz .+0x00000011 (0x000095a0=singleRelease@40) : 75 11 0000958f: movl %ds:(%edx), %eax : 8B 42 00 00009592: shrl $0x0a, %eax : C1 E8 0A
00009595: andl $0x0000007c, %eax : 83 E0 7C 00009598: jnz .+0x00000006 (0x000095a0=singleRelease@40) : 75 06 0000959a: movl %ds:0xfffffffc(%edx), %eax : 8B 42 FC 0000959d: andl $0xfffffffc, %eax : 83 E0 FC
000095a0: cmpl %ecx, %eax : 39 C8 000095a2: jnz .+0xffffffda (0x0000957e=LSICMissCall) : 75 DA In VisualWorks the code looks like movl %ebx, %eax
andl $3, %eax jnz LCompare movl (%ebx), %eax LCompare: cmpl %eax, %edx jnz +0xffffff??=LSICMissCall That's 9 or 11 instructions (compact vs non-compact) vs 6 instructions in the common case, but vitally, for non-compact classes 2 memory reads vs one.
So indeed object representation can make a major difference in run-time performance. Consider how much quicker object allocation is in VW, which does not have to check if the receiving class is compact or not, compared to Squeak. Consider how much quicker string access is in VW, which has immediate characters, than Squeak with the character table and the inability to do == comparisons on Unicode characters. etc. etc.
> Cheers, Best Eliot
|
In reply to this post by Eliot Miranda-2
ok, most of this stuff flies high above my head, but thanks for the
explanation :) Stef |
In reply to this post by Eliot Miranda-2
2009/3/1 Eliot Miranda <[hidden email]>:
> > > On Sun, Mar 1, 2009 at 12:23 PM, Igor Stasenko <[hidden email]> wrote: >> >> 2009/3/1 Andreas Raab <[hidden email]>: >> > Igor Stasenko wrote: >> >> >> >> Changing the object formats alone does not gives any benefits. What is >> >> the point in having new format when you keep using old semantic model >> >> as before? >> > >> > Speed. That is the only point of the exercise to begin with. >> > >> >> This is like swapping instance variables order in your class.. Apart >> >> from a better aestetical view it gives you nothing :) >> > >> > If swapping ivars in a class would give me a 3x in performance I'd be >> > doing >> > this all day long... >> > >> but we both know that this is too good to be true. :) >> unless you change the way how things working, you can't achieve >> significant performance boost. And often this means rewriting >> interfaces, which inevitably leads to changing a lot of code on >> language side etc. > > Uh, no. Here is the inline cache check in Cog, which is as complicated as > it is because of compact classes: > 00009588: movl %edx, %eax : 89 D0 > 0000958a: andl $0x00000001, %eax : 83 E0 01 > 0000958d: jnz .+0x00000011 (0x000095a0=singleRelease@40) : 75 11 > 0000958f: movl %ds:(%edx), %eax : 8B 42 00 > 00009592: shrl $0x0a, %eax : C1 E8 0A > 00009595: andl $0x0000007c, %eax : 83 E0 7C > 00009598: jnz .+0x00000006 (0x000095a0=singleRelease@40) : 75 06 > 0000959a: movl %ds:0xfffffffc(%edx), %eax : 8B 42 FC > 0000959d: andl $0xfffffffc, %eax : 83 E0 FC > 000095a0: cmpl %ecx, %eax : 39 C8 > 000095a2: jnz .+0xffffffda (0x0000957e=LSICMissCall) : 75 DA > In VisualWorks the code looks like > movl %ebx, %eax > andl $3, %eax > jnz LCompare > movl (%ebx), %eax > LCompare: > cmpl %eax, %edx > jnz +0xffffff??=LSICMissCall > That's 9 or 11 instructions (compact vs non-compact) vs 6 instructions in > the common case, but vitally, for non-compact classes 2 memory reads vs one. > So indeed object representation can make a major difference in run-time > performance. Consider how much quicker object allocation is in VW, which > does not have to check if the receiving class is compact or not, compared to > Squeak. Consider how much quicker string access is in VW, which has > immediate characters, than Squeak with the character table and the inability > to do == comparisons on Unicode characters. etc. etc. Sometimes I having troubles with expressing my thoughts clearly.. sorry. I din't mean that changing object format does not improves the speed. I meant that such changes alone is very hard to adopt without ANY changes on language side. See Behavior>>becomeCompact becomeCompactSimplyAt: index becomeUncompact see also #compactClassesArray and i suspect this list is only a top of the iceberg (for instance, you may need to change SpaceTally to report things properly). Now, defending you point, that really, it would be much easier to deal with such things in a micro-image (consider the amount of code and tests which you need to perform when producing new update). This makes you, as a VM developer be responsible from good integration of VM with language side. Then rest images, which is based on it will have to use things strictly in manner, as it put in kernel. It is important to draw a line between kernel and rest of the code in image, which depends on it. >> >> > Cheers, >> > - Andreas >> > >> -- >> Best regards, >> Igor Stasenko AKA sig. > > Best > Eliot > > > -- Best regards, Igor Stasenko AKA sig. |
Free forum by Nabble | Edit this page |