2GB changes file and a pony (was: [squeak-dev] ALL CLEAR (Re:
CompiledMethodTrailers ready for use))
David T. Lewis
lewis at mail.msen.com
Thu Dec 24 03:50:01 UTC 2009
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
More information about the Squeak-dev
mailing list
|