comp.lang.ada
 help / color / mirror / Atom feed
From: ytomino <aghia05@gmail.com>
Subject: Re: Problem in "X (1).Re := X (1).Re + 1"
Date: Wed, 9 May 2012 22:23:02 -0700 (PDT)
Date: 2012-05-09T22:23:02-07:00	[thread overview]
Message-ID: <32104244.53.1336627382831.JavaMail.geo-discussion-forums@pbcui5> (raw)
In-Reply-To: <jof3fv$40m$1@munin.nbi.dk>

On Thursday, May 10, 2012 9:52:12 AM UTC+9, Randy Brukardt wrote:
> 
> Sure, the containers have some operations where this implementation would be 
> a benefit. But I would guess that those operations would be used very rarely 
> (if ever), so optimizing for them would be a mistake.
> 
> I think this is similar to the usage of the operations in 
> Ada.Strings.Unbounded. There are many operations defined in that package, 
> but most code I've seen only uses a handful of those operations. Optimizing 
> for the other operations is wasted effort.

(This my opinion is unrelated to main subject.)

I could understand it. But I don't want to be satisfied.

Even if Ada.Strings.Unbounded.Replace_Slice *with resizing* is very slow, I will not worry.
However, if Replace_Slice *without resizing* is very slow, I will be angry.
Because, it's getting worse from raw array.
(Of course, exclude the time for memory management. It's main reason to use Unbounded_String.)
And, Vectors is also made to be similar to array. "&" is very popular primitive on array. It should not be worse though it's rarely.

Perhaps, reference counting is exaggerated, such as your saying.
In practice, something that is lighter than reference counting like move semantics (of C++) can satisfy it.

Recently, in GNAT, reference counting is implemented into Unbounded_String.
So, I also expect Vectors.

> That's way I said it might make sense to use this implementation in your own 
> container package, because your usage patterns might be far from typical. 
> (There cannot be a one-size-really-fits-all implementation.)



  reply	other threads:[~2012-05-10  5:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-05 12:55 Problem in "X (1).Re := X (1).Re + 1" ytomino
2012-05-07 15:37 ` Adam Beneschan
2012-05-07 18:53   ` ytomino
2012-05-07 21:28     ` Adam Beneschan
2012-05-08  1:14       ` Randy Brukardt
2012-05-08 17:14         ` Adam Beneschan
2012-05-08 22:29           ` Randy Brukardt
2012-05-09  8:41             ` ytomino
2012-05-10  0:52               ` Randy Brukardt
2012-05-10  5:23                 ` ytomino [this message]
2012-05-09  9:29           ` ytomino
2012-05-10  0:58             ` Randy Brukardt
2012-05-10  4:26               ` ytomino
2012-05-15  6:09                 ` Randy Brukardt
2012-05-15 20:17                   ` ytomino
2012-05-16  0:01                     ` Randy Brukardt
2012-05-15 22:12               ` Simon Wright
2012-05-16  7:14                 ` Dmitry A. Kazakov
2012-05-09  8:05       ` ytomino
2012-05-09 11:03         ` ytomino
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox