CompiledMethodTrailers ready for use

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

CompiledMethodTrailers ready for use

Igor Stasenko
Hello,
i finished this stuff, and its ready for adoption.

See http://bugs.squeak.org/view.php?id=7428

Anyone wants to help pushing it into trunk update stream (using MC configs)?

It works fine on recent trunk image,
on pharo however i had some problems installing changes, because of
some differencies.

Tried on PharoCore-1.1-11106-ALPHA.image

phase2.1.cs
- do not filein the TextEditor changes, since pharo-core don't have it.
- do not filein the last line (reorganizing)..

- tests failing because pharo String class does not implements
#squeakToUtf8
nor
#utf8ToSqueak

Do we having an uniform way how to encode  ANY String -> ByteString(utf8)
and back? What ANSI standard saying about it? Maybe i'm using wrong methods?

Still, i think we need this thing standartized and be common for all
dialects (not just Pharo/Squeak).

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethodTrailers ready for use

Igor Stasenko
2009/12/20 Igor Stasenko <[hidden email]>:

> Hello,
> i finished this stuff, and its ready for adoption.
>
> See http://bugs.squeak.org/view.php?id=7428
>
> Anyone wants to help pushing it into trunk update stream (using MC configs)?
>
> It works fine on recent trunk image,
> on pharo however i had some problems installing changes, because of
> some differencies.
>
> Tried on PharoCore-1.1-11106-ALPHA.image
>
> phase2.1.cs
> - do not filein the TextEditor changes, since pharo-core don't have it.
> - do not filein the last line (reorganizing)..
>
> - tests failing because pharo String class does not implements
> #squeakToUtf8
> nor
> #utf8ToSqueak
>
> Do we having an uniform way how to encode  ANY String -> ByteString(utf8)
> and back? What ANSI standard saying about it? Maybe i'm using wrong methods?
>

Update:
- fixed the utf8 stuff, by using a #convertToEncoding: / #convertFromEncoding:
- @Pharoers: do not file-in a reorganize crap, attached in *phase* and
*cleanup* changesets.


There is an issue with #defaultMethodTrailer implementation, which i
missed to change.
In trunk, i changed it in TCompilingBehavior
but in Pharo, there's no such trait.
There is an additional .cs to fix that
(see notes on mantis)

Pfff.. i hope i din't miss anything this time :)

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

ALL CLEAR (Re: CompiledMethodTrailers ready for use)

Andreas.Raab
In reply to this post by Igor Stasenko
Folks -

We're all clear now after the CompiledMethodTrailer changes.
Can I have a 2GB changes file now? And a pony? :)

Cheers,
   - Andreas

Igor Stasenko wrote:

> Hello,
> i finished this stuff, and its ready for adoption.
>
> See http://bugs.squeak.org/view.php?id=7428
>
> Anyone wants to help pushing it into trunk update stream (using MC configs)?
>
> It works fine on recent trunk image,
> on pharo however i had some problems installing changes, because of
> some differencies.
>
> Tried on PharoCore-1.1-11106-ALPHA.image
>
> phase2.1.cs
> - do not filein the TextEditor changes, since pharo-core don't have it.
> - do not filein the last line (reorganizing)..
>
> - tests failing because pharo String class does not implements
> #squeakToUtf8
> nor
> #utf8ToSqueak
>
> Do we having an uniform way how to encode  ANY String -> ByteString(utf8)
> and back? What ANSI standard saying about it? Maybe i'm using wrong methods?
>
> Still, i think we need this thing standartized and be common for all
> dialects (not just Pharo/Squeak).
>


Reply | Threaded
Open this post in threaded view
|

Re: ALL CLEAR (Re: CompiledMethodTrailers ready for use)

Igor Stasenko
2009/12/22 Andreas Raab <[hidden email]>:
> Folks -
>
> We're all clear now after the CompiledMethodTrailer changes.
> Can I have a 2GB changes file now? And a pony? :)
>

Not sure about pony, but 2GB is not a problem. :)
New trailers accepting any source pointer values (any positive
integer).. and its up to file management layer how to interpret them.


> Cheers,
>  - Andreas
>
> Igor Stasenko wrote:
>>
>> Hello,
>> i finished this stuff, and its ready for adoption.
>>
>> See http://bugs.squeak.org/view.php?id=7428
>>
>> Anyone wants to help pushing it into trunk update stream (using MC
>> configs)?
>>
>> It works fine on recent trunk image,
>> on pharo however i had some problems installing changes, because of
>> some differencies.
>>
>> Tried on PharoCore-1.1-11106-ALPHA.image
>>
>> phase2.1.cs
>> - do not filein the TextEditor changes, since pharo-core don't have it.
>> - do not filein the last line (reorganizing)..
>>
>> - tests failing because pharo String class does not implements
>> #squeakToUtf8
>> nor
>> #utf8ToSqueak
>>
>> Do we having an uniform way how to encode  ANY String -> ByteString(utf8)
>> and back? What ANSI standard saying about it? Maybe i'm using wrong
>> methods?
>>
>> Still, i think we need this thing standartized and be common for all
>> dialects (not just Pharo/Squeak).
>>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

David T. Lewis
In reply to this post by Andreas.Raab
On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
> Folks -
>
> We're all clear now after the CompiledMethodTrailer changes.
> Can I have a 2GB changes file now? And a pony? :)
>

Here's the 2GB changes file patch. File it in, run tests, install
with ExpandedSourceFileArray install.

You will want to disable the changes size check in #checkOKToAdd:at:
and also arrange for the ExpandedSourceFileArray to be installed
at image startup.

I was able to grow a changes file beyond 32M, and verified that
the image has large sourcePointer values beyond the range previously
allowed.

  (CompiledMethod allInstances collect: [:e | e sourcePointer]) max hex ==> '6054DAA'

I'm not so sure about the pony, but Randal promised to send one ;)

Cheers,
Dave




ExpandedSourceFileArray-dtl.1.cs (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Igor Stasenko
2009/12/23 David T. Lewis <[hidden email]>:

> On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
>> Folks -
>>
>> We're all clear now after the CompiledMethodTrailer changes.
>> Can I have a 2GB changes file now? And a pony? :)
>>
>
> Here's the 2GB changes file patch. File it in, run tests, install
> with ExpandedSourceFileArray install.
>

so, we're now bound to VM file-size handling limitation, or its using
64-bits for file pointers?
2GB is better than 32M.. but still small :)

> You will want to disable the changes size check in #checkOKToAdd:at:
> and also arrange for the ExpandedSourceFileArray to be installed
> at image startup.
>
> I was able to grow a changes file beyond 32M, and verified that
> the image has large sourcePointer values beyond the range previously
> allowed.
>
>  (CompiledMethod allInstances collect: [:e | e sourcePointer]) max hex ==> '6054DAA'
>
> I'm not so sure about the pony, but Randal promised to send one ;)
>
> Cheers,
> Dave
>
>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

johnmci
It should be 64bit since I made that change years back. However most
(all?) file systems don't support all 64 bit of space. Still it was
intersting to learn I could make terabyte sparse file on my freebsd
system.

So is it 2gb or 4gb? Is that a limit due to 32bit signed numbers?

On 12/23/09, Igor Stasenko <[hidden email]> wrote:

> 2009/12/23 David T. Lewis <[hidden email]>:
>> On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
>>> Folks -
>>>
>>> We're all clear now after the CompiledMethodTrailer changes.
>>> Can I have a 2GB changes file now? And a pony? :)
>>>
>>
>> Here's the 2GB changes file patch. File it in, run tests, install
>> with ExpandedSourceFileArray install.
>>
>
> so, we're now bound to VM file-size handling limitation, or its using
> 64-bits for file pointers?
> 2GB is better than 32M.. but still small :)
>
>> You will want to disable the changes size check in #checkOKToAdd:at:
>> and also arrange for the ExpandedSourceFileArray to be installed
>> at image startup.
>>
>> I was able to grow a changes file beyond 32M, and verified that
>> the image has large sourcePointer values beyond the range previously
>> allowed.
>>
>>  (CompiledMethod allInstances collect: [:e | e sourcePointer]) max hex ==>
>> '6054DAA'
>>
>> I'm not so sure about the pony, but Randal promised to send one ;)
>>
>> Cheers,
>> Dave
>>
>>
>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>


--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Igor Stasenko
2009/12/23 John McIntosh <[hidden email]>:
> It should be 64bit since I made that change years back. However most
> (all?) file systems don't support all 64 bit of space. Still it was
> intersting to learn I could make terabyte sparse file on my freebsd
> system.
>
> So is it 2gb or 4gb? Is that a limit due to 32bit signed numbers?
>
the limit was in a method sourcePointer, which were using up to 4
bytes in method's trailer (and some bits reserved).
Now this is no longer issue, and you can encode any integer value (>0)
as sourcePointer in method's trailer.
So it is now up to stream/file primitives to handle these big numbers well.

> On 12/23/09, Igor Stasenko <[hidden email]> wrote:
>> 2009/12/23 David T. Lewis <[hidden email]>:
>>> On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
>>>> Folks -
>>>>
>>>> We're all clear now after the CompiledMethodTrailer changes.
>>>> Can I have a 2GB changes file now? And a pony? :)
>>>>
>>>
>>> Here's the 2GB changes file patch. File it in, run tests, install
>>> with ExpandedSourceFileArray install.
>>>
>>
>> so, we're now bound to VM file-size handling limitation, or its using
>> 64-bits for file pointers?
>> 2GB is better than 32M.. but still small :)
>>
>>> You will want to disable the changes size check in #checkOKToAdd:at:
>>> and also arrange for the ExpandedSourceFileArray to be installed
>>> at image startup.
>>>
>>> I was able to grow a changes file beyond 32M, and verified that
>>> the image has large sourcePointer values beyond the range previously
>>> allowed.
>>>
>>>  (CompiledMethod allInstances collect: [:e | e sourcePointer]) max hex ==>
>>> '6054DAA'
>>>
>>> I'm not so sure about the pony, but Randal promised to send one ;)
>>>
>>> Cheers,
>>> Dave
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>>
>
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

David T. Lewis
In reply to this post by Igor Stasenko
On Wed, Dec 23, 2009 at 10:27:29AM +0200, Igor Stasenko wrote:

> 2009/12/23 David T. Lewis <[hidden email]>:
> > On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
> >> Folks -
> >>
> >> We're all clear now after the CompiledMethodTrailer changes.
> >> Can I have a 2GB changes file now? And a pony? :)
> >>
> >
> > Here's the 2GB changes file patch. File it in, run tests, install
> > with ExpandedSourceFileArray install.
> >
>
> so, we're now bound to VM file-size handling limitation, or its using
> 64-bits for file pointers?
> 2GB is better than 32M.. but still small :)
>

Now that CompiledMethod can address unlimited address space, all
that was required was to is to implement three small methods in
a subclass of SourceFileArray (*). So if somebody invents a file
system that maps to all the particles in the universe, we can
easily expand the changes file to make use if it. And as you point
out in another message, it should now be easier to map to things
that are not traditional file systems at all, which does open up
some interesting possibilities.

(*) BTW, I did not put much effort into computational efficiency
in those three methods, no doubt there is room for improvement.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Eliot Miranda-2


On Wed, Dec 23, 2009 at 6:43 AM, David T. Lewis <[hidden email]> wrote:
On Wed, Dec 23, 2009 at 10:27:29AM +0200, Igor Stasenko wrote:
> 2009/12/23 David T. Lewis <[hidden email]>:
> > On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
> >> Folks -
> >>
> >> We're all clear now after the CompiledMethodTrailer changes.
> >> Can I have a 2GB changes file now? And a pony? :)
> >>
> >
> > Here's the 2GB changes file patch. File it in, run tests, install
> > with ExpandedSourceFileArray install.
> >
>
> so, we're now bound to VM file-size handling limitation, or its using
> 64-bits for file pointers?
> 2GB is better than 32M.. but still small :)
>

Now that CompiledMethod can address unlimited address space, all
that was required was to is to implement three small methods in
a subclass of SourceFileArray (*). So if somebody invents a file
system that maps to all the particles in the universe, we can
easily expand the changes file to make use if it. And as you point
out in another message, it should now be easier to map to things
that are not traditional file systems at all, which does open up
some interesting possibilities.

I'm not up-to-date with the changes.  Are you making sure that the new source manager includes read-only copies of the source files so that fetching source does not involve creating a new file?


(*) BTW, I did not put much effort into computational efficiency
in those three methods, no doubt there is room for improvement.

Dave





Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

David T. Lewis
On Wed, Dec 23, 2009 at 10:27:42AM -0800, Eliot Miranda wrote:

> On Wed, Dec 23, 2009 at 6:43 AM, David T. Lewis <[hidden email]> wrote:
>
> > On Wed, Dec 23, 2009 at 10:27:29AM +0200, Igor Stasenko wrote:
> > > 2009/12/23 David T. Lewis <[hidden email]>:
> > > > On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
> > > >> Folks -
> > > >>
> > > >> We're all clear now after the CompiledMethodTrailer changes.
> > > >> Can I have a 2GB changes file now? And a pony? :)
> > > >>
> > > >
> > > > Here's the 2GB changes file patch. File it in, run tests, install
> > > > with ExpandedSourceFileArray install.
> > > >
> > >
> > > so, we're now bound to VM file-size handling limitation, or its using
> > > 64-bits for file pointers?
> > > 2GB is better than 32M.. but still small :)
> > >
> >
> > Now that CompiledMethod can address unlimited address space, all
> > that was required was to is to implement three small methods in
> > a subclass of SourceFileArray (*). So if somebody invents a file
> > system that maps to all the particles in the universe, we can
> > easily expand the changes file to make use if it. And as you point
> > out in another message, it should now be easier to map to things
> > that are not traditional file systems at all, which does open up
> > some interesting possibilities.
> >
>
> I'm not up-to-date with the changes.  Are you making sure that the new
> source manager includes read-only copies of the source files so that
> fetching source does not involve creating a new file?
The class that I posted affects only the address mapping and would
not affect any other aspects of source file mapping.

That said, performance is poor so this is not ready for prime time.
I'm attaching an update that is somewhat less bad, but still nowhere
near good enough (3 or 4 times slower than StandardSourceFileArray).

I will not put this in the inbox until performance is at a more
reasonable level.  Help from the more capable bit twiddlers is
welcome (need a more efficient way to test an integer for bit
25 set).

Dave




ExpandedSourceFileArray-dtl.2.cs (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Igor Stasenko
2009/12/23 David T. Lewis <[hidden email]>:

> On Wed, Dec 23, 2009 at 10:27:42AM -0800, Eliot Miranda wrote:
>> On Wed, Dec 23, 2009 at 6:43 AM, David T. Lewis <[hidden email]> wrote:
>>
>> > On Wed, Dec 23, 2009 at 10:27:29AM +0200, Igor Stasenko wrote:
>> > > 2009/12/23 David T. Lewis <[hidden email]>:
>> > > > On Tue, Dec 22, 2009 at 01:59:34PM +0100, Andreas Raab wrote:
>> > > >> Folks -
>> > > >>
>> > > >> We're all clear now after the CompiledMethodTrailer changes.
>> > > >> Can I have a 2GB changes file now? And a pony? :)
>> > > >>
>> > > >
>> > > > Here's the 2GB changes file patch. File it in, run tests, install
>> > > > with ExpandedSourceFileArray install.
>> > > >
>> > >
>> > > so, we're now bound to VM file-size handling limitation, or its using
>> > > 64-bits for file pointers?
>> > > 2GB is better than 32M.. but still small :)
>> > >
>> >
>> > Now that CompiledMethod can address unlimited address space, all
>> > that was required was to is to implement three small methods in
>> > a subclass of SourceFileArray (*). So if somebody invents a file
>> > system that maps to all the particles in the universe, we can
>> > easily expand the changes file to make use if it. And as you point
>> > out in another message, it should now be easier to map to things
>> > that are not traditional file systems at all, which does open up
>> > some interesting possibilities.
>> >
>>
>> I'm not up-to-date with the changes.  Are you making sure that the new
>> source manager includes read-only copies of the source files so that
>> fetching source does not involve creating a new file?
>
> The class that I posted affects only the address mapping and would
> not affect any other aspects of source file mapping.
>
> That said, performance is poor so this is not ready for prime time.
> I'm attaching an update that is somewhat less bad, but still nowhere
> near good enough (3 or 4 times slower than StandardSourceFileArray).
>

Dave, i think this is too minor case to care about. Using/computing
sourcePointer usually leads to file operation(s),
which completely nivelating the difference comparing to
StandardSourceFileArray, because file operations working at really
different performance scale (100 to 1000 times slower than any integer
arithmetics) :)


> I will not put this in the inbox until performance is at a more
> reasonable level.  Help from the more capable bit twiddlers is
> welcome (need a more efficient way to test an integer for bit
> 25 set).
>

its easy to tweak it using bit-shifts & bit-masks only (to avoid division).
But since results will be the same, i wouldn't pay much attention to it.


> Dave
>
>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Levente Uzonyi-2
In reply to this post by David T. Lewis
On Wed, 23 Dec 2009, David T. Lewis wrote:
>
> That said, performance is poor so this is not ready for prime time.
> I'm attaching an update that is somewhat less bad, but still nowhere
> near good enough (3 or 4 times slower than StandardSourceFileArray).
>

Which part is 3-4 times slower? Can you show us your benchmark?


Levente


> I will not put this in the inbox until performance is at a more
> reasonable level.  Help from the more capable bit twiddlers is
> welcome (need a more efficient way to test an integer for bit
> 25 set).
>
> Dave
>
>

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Igor Stasenko
Btw,
don't forget to remove
checkOKToAdd: size at: filePosition

if you going to adopt this changeset into trunk.



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

David T. Lewis
In reply to this post by Levente Uzonyi-2
On Wed, Dec 23, 2009 at 11:07:54PM +0100, Levente Uzonyi wrote:
> On Wed, 23 Dec 2009, David T. Lewis wrote:
> >
> >That said, performance is poor so this is not ready for prime time.
> >I'm attaching an update that is somewhat less bad, but still nowhere
> >near good enough (3 or 4 times slower than StandardSourceFileArray).
> >
>
> Which part is 3-4 times slower? Can you show us your benchmark?
>

I'm glad you asked. There was a typo in my test, and performance
seems to be pretty good after all. Here is what I was checking:

  Time millisecondsToRun: [
        sf := StandardSourceFileArray new.
        (16r1000000 to: 16r1FFFFFF by: 11) do: [:e |
                i := sf fileIndexFromSourcePointer: e.
                p := sf filePositionFromSourcePointer: e.
                a := sf sourcePointerFromFileIndex: i andPosition: p.
                a = e ifFalse: [self error: 'snafu']]
        ] ==> 3391

  Time millisecondsToRun: [
        sf := ExpandedSourceFileArray new.
        (16r1000000 to: 16r1FFFFFF by: 11) do: [:e |
                i := sf fileIndexFromSourcePointer: e.
                p := sf filePositionFromSourcePointer: e.
                a := sf sourcePointerFromFileIndex: i andPosition: p.
                a = e ifFalse: [self error: 'snafu']]
        ] ==> 3220


Dave


Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Levente Uzonyi-2
On Wed, 23 Dec 2009, David T. Lewis wrote:

> On Wed, Dec 23, 2009 at 11:07:54PM +0100, Levente Uzonyi wrote:
>> On Wed, 23 Dec 2009, David T. Lewis wrote:
>>>
>>> That said, performance is poor so this is not ready for prime time.
>>> I'm attaching an update that is somewhat less bad, but still nowhere
>>> near good enough (3 or 4 times slower than StandardSourceFileArray).
>>>
>>
>> Which part is 3-4 times slower? Can you show us your benchmark?
>>
>
> I'm glad you asked. There was a typo in my test, and performance
> seems to be pretty good after all. Here is what I was checking:
>
>  Time millisecondsToRun: [
> sf := StandardSourceFileArray new.
> (16r1000000 to: 16r1FFFFFF by: 11) do: [:e |
> i := sf fileIndexFromSourcePointer: e.
> p := sf filePositionFromSourcePointer: e.
> a := sf sourcePointerFromFileIndex: i andPosition: p.
> a = e ifFalse: [self error: 'snafu']]
> ] ==> 3391
>
>  Time millisecondsToRun: [
> sf := ExpandedSourceFileArray new.
> (16r1000000 to: 16r1FFFFFF by: 11) do: [:e |
> i := sf fileIndexFromSourcePointer: e.
> p := sf filePositionFromSourcePointer: e.
> a := sf sourcePointerFromFileIndex: i andPosition: p.
> a = e ifFalse: [self error: 'snafu']]
> ] ==> 3220
>

My slightly modified (but semantically the same) version:

{ StandardSourceFileArray. ExpandedSourceFileArray } collect: [ :class |
  [
  | sf |
  sf := class new.
  16r1000000 to: 16r1FFFFFF by: 11 do: [:e |
  | i p a |
  i := sf fileIndexFromSourcePointer: e.
  p := sf filePositionFromSourcePointer: e.
  a := sf sourcePointerFromFileIndex: i andPosition: p.
  a = e ifFalse: [self error: 'snafu' ] ] ] timeToRun ]

gives #(766 682) on my pc.

So I think the performance is "solved". :)


Levente

>
> Dave
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

David T. Lewis
On Thu, Dec 24, 2009 at 02:30:38AM +0100, Levente Uzonyi wrote:

> On Wed, 23 Dec 2009, David T. Lewis wrote:
>
> >On Wed, Dec 23, 2009 at 11:07:54PM +0100, Levente Uzonyi wrote:
> >>On Wed, 23 Dec 2009, David T. Lewis wrote:
> >>>
> >>>That said, performance is poor so this is not ready for prime time.
> >>>I'm attaching an update that is somewhat less bad, but still nowhere
> >>>near good enough (3 or 4 times slower than StandardSourceFileArray).
> >>>
> >>
> >>Which part is 3-4 times slower? Can you show us your benchmark?
> >>
> >
> >I'm glad you asked. There was a typo in my test, and performance
> >seems to be pretty good after all. Here is what I was checking:
> >
> > Time millisecondsToRun: [
> > sf := StandardSourceFileArray new.
> > (16r1000000 to: 16r1FFFFFF by: 11) do: [:e |
> > i := sf fileIndexFromSourcePointer: e.
> > p := sf filePositionFromSourcePointer: e.
> > a := sf sourcePointerFromFileIndex: i andPosition: p.
> > a = e ifFalse: [self error: 'snafu']]
> > ] ==> 3391
> >
> > Time millisecondsToRun: [
> > sf := ExpandedSourceFileArray new.
> > (16r1000000 to: 16r1FFFFFF by: 11) do: [:e |
> > i := sf fileIndexFromSourcePointer: e.
> > p := sf filePositionFromSourcePointer: e.
> > a := sf sourcePointerFromFileIndex: i andPosition: p.
> > a = e ifFalse: [self error: 'snafu']]
> > ] ==> 3220
> >
>
> My slightly modified (but semantically the same) version:
>
> { StandardSourceFileArray. ExpandedSourceFileArray } collect: [ :class |
> [
> | sf |
> sf := class new.
> 16r1000000 to: 16r1FFFFFF by: 11 do: [:e |
> | i p a |
> i := sf fileIndexFromSourcePointer: e.
> p := sf filePositionFromSourcePointer: e.
> a := sf sourcePointerFromFileIndex: i andPosition: p.
> a = e ifFalse: [self error: 'snafu' ] ] ] timeToRun ]
>
> gives #(766 682) on my pc.
>
> So I think the performance is "solved". :)

Levente, Igor,

Thank you. Apparently I accidentally concluded that there was a
performance problem, then profiled and tweaked it a bit, with the
net result that performance is very slightly improved compared to
StandardSourceFileArray. This has no practical impact whatsoever,
but I guess there are worse things that could result from a dumb
mistake :)

Dave


Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

David T. Lewis
In reply to this post by johnmci
On Wed, Dec 23, 2009 at 01:19:43AM -0800, John McIntosh wrote:
> It should be 64bit since I made that change years back. However most
> (all?) file systems don't support all 64 bit of space. Still it was
> intersting to learn I could make terabyte sparse file on my freebsd
> system.

Let's see (counting on fingers) I think that a 64 bit address
space is about a trillion times bigger than the current changes
files limit, so that should be sufficient for the next few years.

>
> So is it 2gb or 4gb? Is that a limit due to 32bit signed numbers?

Various FAT and Linux file systems are limited to 2GB. Very likely
it's due to the use of signed ints for addressing. I'm just guessing
here, but if you use a signed int, you can easily tell if the size
exceeds 2GB by testing for file pointer less than zero. Besides,
who would ever dream of trying to address more than 2GB of space
for a single file? I mean, how may floppy disks is that, anyway?

If we ever get to the point where this matters for a Squeak changes
file, then it will absolutely, positively be time for someone to
burn the disk packs. It will be a very large bonfire, and we can
all roast marshmellows :)

Dave


Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

Igor Stasenko
Btw, Dave
since your changes are 100% backwards compatible,
i think we can just patch the existing class, instead of creating a new one.
What you think?

2009/12/24 David T. Lewis <[hidden email]>:

> On Wed, Dec 23, 2009 at 01:19:43AM -0800, John McIntosh wrote:
>> It should be 64bit since I made that change years back. However most
>> (all?) file systems don't support all 64 bit of space. Still it was
>> intersting to learn I could make terabyte sparse file on my freebsd
>> system.
>
> Let's see (counting on fingers) I think that a 64 bit address
> space is about a trillion times bigger than the current changes
> files limit, so that should be sufficient for the next few years.
>
>>
>> So is it 2gb or 4gb? Is that a limit due to 32bit signed numbers?
>
> Various FAT and Linux file systems are limited to 2GB. Very likely
> it's due to the use of signed ints for addressing. I'm just guessing
> here, but if you use a signed int, you can easily tell if the size
> exceeds 2GB by testing for file pointer less than zero. Besides,
> who would ever dream of trying to address more than 2GB of space
> for a single file? I mean, how may floppy disks is that, anyway?
>
> If we ever get to the point where this matters for a Squeak changes
> file, then it will absolutely, positively be time for someone to
> burn the disk packs. It will be a very large bonfire, and we can
> all roast marshmellows :)
>
> Dave
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: 2GB changes file and a pony (was: ALL CLEAR (Re: CompiledMethodTrailers ready for use))

David T. Lewis
On Thu, Dec 24, 2009 at 06:07:28PM +0200, Igor Stasenko wrote:
> Btw, Dave
> since your changes are 100% backwards compatible,
> i think we can just patch the existing class, instead of creating a new one.
> What you think?

Yes, you're right. But I feel safer putting in a new class that can
be reverted easily, and maybe combining them later if no problems
arise. Also I think that other folks may have good ideas for different
implementations of SourceFileArray, and maybe it is a good idea to
leave the original StandardSourceFileArray as a reference.

Anyway, I am running an image with a large changes file now, and
if I don't find any problems I'll add it to the trunk within the
next day or so.

Dave
 

12