Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion appending to a Vector

Received: by 10.58.161.236 with SMTP id xv12mr6354483veb.5.1351443739017;
        Sun, 28 Oct 2012 10:02:19 -0700 (PDT)
X-BeenThere: scala-user@googlegroups.com
Received: by 10.220.156.210 with SMTP id y18ls939157vcw.2.gmail; Sun, 28 Oct
 2012 10:02:16 -0700 (PDT)
Received: by 10.59.0.234 with SMTP id bb10mr6734685ved.32.1351443736163;
        Sun, 28 Oct 2012 10:02:16 -0700 (PDT)
Received: by 10.59.0.234 with SMTP id bb10mr6734684ved.32.1351443736141;
        Sun, 28 Oct 2012 10:02:16 -0700 (PDT)
Return-Path: <viktor.kl...@gmail.com>
Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182])
        by gmr-mx.google.com with ESMTPS id es5si837948vdb.2.2012.10.28.10.02.16
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 28 Oct 2012 10:02:16 -0700 (PDT)
Received-SPF: pass (google.com: domain of viktor.kl...@gmail.com designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of viktor.kl...@gmail.com designates 209.85.220.182 as permitted sender) smtp.mail=viktor.kl...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-vc0-f182.google.com with SMTP id fw7so5685161vcb.13
        for <scala-user@googlegroups.com>; Sun, 28 Oct 2012 10:02:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc:content-type;
        bh=PgLwuQ7PDkzPiEdxF8Hof1WXJ8yIL/UoOlS/gOGU5rI=;
        b=YqCIzMvkPOt3fYdB56pEYxUAx/QSd7CocjfGyoMpsCBZxceH8CIhnmlbCFhpysQuZ3
         KXfp0J/FSjyw1Rtu22sQk6if05obqvy+gqeafOLLRT+N5Qvea/hiMuhPslXiQmkHcKxh
         O84jcf96qYR95pDFOQ75ZlC/bw6YrV0jsO3ip38UkgvsqD93vvhFW+MXyf8klB9HUTEf
         F6ZVEM2j6lW9SDw4WfLmJ1BmzV0PvaQknZjyIFQkcp8TKToC71kGi/+r20/ogEj0od1H
         NsgCNToi3Zxbf4U9K5WqxdMWFkXceqSp3+C4cmVK+vXLIGzLCpZPgUV61dUIqDXA1E0S
         aq3g==
MIME-Version: 1.0
Received: by 10.52.92.11 with SMTP id ci11mr35922702vdb.7.1351443735958; Sun,
 28 Oct 2012 10:02:15 -0700 (PDT)
Received: by 10.58.207.169 with HTTP; Sun, 28 Oct 2012 10:02:15 -0700 (PDT)
In-Reply-To: <CAP_xLa0BQE0pe_9O7j+128hBdvpiinC7MfD0ic9Pi6TXy1C...@mail.gmail.com>
References: <846afeae-733f-42f9-827a-92cdb01b8177@googlegroups.com>
	<CAHyB3VW1m0UhxESBmG3ngDFBSu_ctwhA44w-qZT-ED7gjpS...@mail.gmail.com>
	<3abf023c-ff35-403c-9cac-f59b3456ceb3@googlegroups.com>
	<CAP_xLa2svuWMdto8DPC=JacLff_HW2wpbgAh2wNVz=LOO6N...@mail.gmail.com>
	<CAMuksQ-2L3jFWaL-+zJanhsjCSsAi7C5sXLkRKtQhayV_AG...@mail.gmail.com>
	<7911B85F-EC56-4F14-B4DB-5F815820E...@epfl.ch>
	<CAP_xLa0Up1X0kPD12p5Gg9Thb2UPZqGZc1=8Gq4A-ubv54O...@mail.gmail.com>
	<CAMuksQ_iC-qteJmdh8xkTTN3q_ieie6V1aWGg=ErY5LTAFG...@mail.gmail.com>
	<CAP_xLa1=o2A2WciJNnO2Yt=rvoqJ8Zxz5wj6u4HBkdaBfp-...@mail.gmail.com>
	<EB3ADDE6-A844-4A2D-8F32-F0410D4C3...@epfl.ch>
	<CAP_xLa0BQE0pe_9O7j+128hBdvpiinC7MfD0ic9Pi6TXy1C...@mail.gmail.com>
Date: Sun, 28 Oct 2012 18:02:15 +0100
Message-ID: <CANPzfU8=+buaAaQHubk=zMA--QkP2W5FDVj_Hv-AL5CKEiH...@mail.gmail.com>
Subject: Re: [scala-user] appending to a Vector
From: =?UTF-8?B?4oiaaWt0b3Ig0qBsYW5n?= <viktor.kl...@gmail.com>
To: Rex Kerr <icho...@gmail.com>
Cc: Tiark Rompf <tiark.ro...@epfl.ch>, "nicolas.o...@gmail.com" <nicolas.o...@gmail.com>, 
	Daniel Sobral <dcsob...@gmail.com>, "Russ P." <russ.paie...@gmail.com>, scala-user@googlegroups.com
Content-Type: multipart/alternative; boundary=20cf3071ce0ad0d3b204cd2183a5

--20cf3071ce0ad0d3b204cd2183a5
Content-Type: text/plain; charset=ISO-8859-1

Trust me, both finalizers and WeakReferences are things you want to avoid
if you want performance.

On Sun, Oct 28, 2012 at 6:01 PM, Rex Kerr <icho...@gmail.com> wrote:

> You reference "count" the linear extension only.  Any branching (i.e. two
> child vectors with the same parent) causes duplication as now.  No cycles.
>
>   --Rex
>
>
> On Sun, Oct 28, 2012 at 12:49 PM, Tiark Rompf <tiark.ro...@epfl.ch> wrote:
>
>> We considered this model for a while -- it's very close to the original
>> VList idea. But we concluded that there's no good way to make it work
>> reliably. There are many hidden costs and of course the knee-jerk response
>> to "ref counting" is "cycles".
>> - Tiark
>>
>> On Oct 28, 2012, at 5:27 PM, Rex Kerr <icho...@gmail.com> wrote:
>>
>> It is trickier to make it safe for space; you need to do reference
>> counting, basically.  I'm now tempted to write Vector as I had imagined it
>> instead of the way it is...ought to be ~6x faster on simple extension and
>> otherwise be pretty much the same except that GC would take two sweeps
>> instead of one to clean out transiently added stuff.
>>
>>   --Rex
>>
>> On Sun, Oct 28, 2012 at 12:06 PM, nicolas.o...@gmail.com <
>> nicolas.o...@gmail.com> wrote:
>>
>>> >
>>> > P.S. (Now the question is why it's not implemented the way I stated for
>>> > performance.)
>>> >
>>> I think because it is not safe for space.
>>>
>>
>>
>>
>


-- 
Viktor Klang

Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
that scale

Twitter: @viktorklang

--20cf3071ce0ad0d3b204cd2183a5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Trust me, both finalizers and WeakReferences are things you want to avoid i=
f you want performance.<br><br><div class=3D"gmail_quote">On Sun, Oct 28, 2=
012 at 6:01 PM, Rex Kerr <span dir=3D"ltr">&lt;<a href=3D"mailto:ichoran@gm=
ail.com" target=3D"_blank">icho...@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">You reference &quot;count&quot; the linear e=
xtension only.=A0 Any branching (i.e. two child vectors with the same paren=
t) causes duplication as now.=A0 No cycles.<span class=3D"HOEnZb"><font col=
or=3D"#888888"><br>
<br>=A0 --Rex</font></span><div class=3D"HOEnZb"><div class=3D"h5"><br><br>=
<div class=3D"gmail_quote">On Sun, Oct 28, 2012 at 12:49 PM, Tiark Rompf <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:tiark.ro...@epfl.ch" target=3D"_blank=
">tiark.ro...@epfl.ch</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"><div>We =
considered this model for a while -- it&#39;s very close to the original VL=
ist idea. But we concluded that there&#39;s no good way to make it work rel=
iably. There are many hidden costs and of course the knee-jerk response to =
&quot;ref counting&quot; is &quot;cycles&quot;.</div>

<span><font color=3D"#888888"><div>- Tiark</div></font></span><div><div><br=
><div><div>On Oct 28, 2012, at 5:27 PM, Rex Kerr &lt;<a href=3D"mailto:icho=
r...@gmail.com" target=3D"_blank">icho...@gmail.com</a>&gt; wrote:</div>
<br><blockquote type=3D"cite">It is trickier to make it safe for space; you=
 need to do reference counting, basically.=A0 I&#39;m now tempted to write =
Vector as I had imagined it instead of the way it is...ought to be ~6x fast=
er on simple extension and otherwise be pretty much the same except that GC=
 would take two sweeps instead of one to clean out transiently added stuff.=
<br>


<br>=A0 --Rex<br><br><div class=3D"gmail_quote">On Sun, Oct 28, 2012 at 12:=
06 PM, <a href=3D"mailto:nicolas.o...@gmail.com" target=3D"_blank">nicolas.=
o...@gmail.com</a> <span dir=3D"ltr">&lt;<a href=3D"mailto:nicolas.oury@gma=
il.com" target=3D"_blank">nicolas.o...@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>&gt;<br>
&gt; P.S. (Now the question is why it&#39;s not implemented the way I state=
d for<br>
&gt; performance.)<br>
&gt;<br>
</div>I think because it is not safe for space.<br>
</blockquote></div><br>
</blockquote></div><br></div></div></div></blockquote></div><br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<span style=3D"border-collapse:separate;color:rgb(0,0,0);font-family:Times;=
font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:nor=
mal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transfo=
rm:none;white-space:normal;word-spacing:0px;font-size:medium"><span style=
=3D"font-family:arial;font-size:small"><span style=3D"border-collapse:colla=
pse;font-family:arial,sans-serif;font-size:13px">Viktor Klang<br>
<br>Akka Tech Lead</span><div><font face=3D"arial, sans-serif"><span style=
=3D"border-collapse:collapse"><a href=3D"http://www.typesafe.com/" target=
=3D"_blank">Typesafe</a><span>=A0</span>- </span></font><span>The software =
stack for applications that scale</span><br>
<font face=3D"arial, sans-serif"><span style=3D"border-collapse:collapse"><=
br></span></font><font face=3D"arial, sans-serif"><span style=3D"border-col=
lapse:collapse">Twitter: @viktorklang</span></font></div></span></span><br>

--20cf3071ce0ad0d3b204cd2183a5--