[m-rev.] For review: Modify deep profiling tools to use new datastructures.
Paul Bone
pbone at csse.unimelb.edu.au
Tue Jul 29 11:39:15 AEST 2008
On Mon, Jul 28, 2008 at 02:07:13PM +1000, Zoltan Somogyi wrote:
> On 25-Jul-2008, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> > I'm preparing a seperate patch to introduce sv_append/3 to
> > library/string.m. Then here I an use sv_append("<br>\n", !HTML)
>
> I don't think that is very intuitive.
>
> Simply using
>
> !:HTML = !.HTML ++ "..."
>
> would do here.
Fixed.
> > It hasn't been a problem yet. This module suffers from the general
> > problem that S = S0 ++ S1 ++ .. ++ Sn, runs in time O(N*length(S0) +
> > (N-1)*length(S1) ...) which is O(N^2).
> >
> > I'd like to leave the code above alone until we're ready to fix the
> > general problem (which is not very high compared to other things we'd
> > like to improve).
>
> The right fix is probably to change the representation of the HTML from
> a simple string to a cord of strings, which is then converted to a single
> string just before being printed out. I can do that after you check in this
> diff. Most of the code won't have to be changed, since ++ is also the operator
> for concatenating cords.
I would prefer that the string module can do this transparently, but
this is a fair bit more work which is why I didn't bother optimising
this at all.
I agree that using cords is the right approach here.
Otherwise I'll check this code in and we can decide if/how to optimise
it later.
> > Now reads:
> >
> > The representation of a procedure in the report structure, including
> > information about it's location in mercury source code.
>
> s/it's/its/
Thanks.
I've committed this change.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20080729/72b18a29/attachment.sig>
More information about the reviews
mailing list