- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
performance question
Sat, 2010-08-14, 12:27
#2
Re: performance question
:)
On 14 August 2010 12:11, Tony Morris <tonymorris@gmail.com> wrote:
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
On 14 August 2010 12:11, Tony Morris <tonymorris@gmail.com> wrote:
scala.Unit
HamsterofDeath wrote:
> which of the collections has the fastest foreach?
>
>
--
Tony Morris
http://tmorris.net/
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sat, 2010-08-14, 12:37
#3
Re: performance question
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
Sat, 2010-08-14, 12:47
#4
Re: performance question
Unit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star@gmx.de> wrote:
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
On 14 August 2010 12:27, HamsterofDeath <h-star@gmx.de> wrote:
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sat, 2010-08-14, 12:57
#5
Re: performance question
It would be really funny if Unit had the forEach method returning Unit:)
Unit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star@gmx.de> wrote:
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sent from my Verizon Wireless BlackBerry
From: Kevin Wright <kev.lee.wright@gmail.com> Date: Sat, 14 Aug 2010 12:31:42 +0100To: HamsterofDeath<h-star@gmx.de>Cc: Tony Morris<tonymorris@gmail.com>; scala-user@listes.epfl.ch<scala-user@listes.epfl.ch>Subject: Re: [scala-user] performance questionUnit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star@gmx.de> wrote:
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sat, 2010-08-14, 12:57
#6
Re: performance question
It does in both Scalaz and Haskell but it has a different name.
scala> trait Semigroup[A] { def append(a1: A, a2: A): A }; class
UnitSemigroup extends Semigroup[Unit] { def append(a1: Unit, a2: Unit) =
() }
>> () `mappend` ()
()
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
Andrew Milkowski wrote:
> It would be really funny if Unit had the forEach method returning Unit:)
>
> Sent from my Verizon Wireless BlackBerry
>
> ------------------------------------------------------------------------
> *From: * Kevin Wright
> *Date: *Sat, 14 Aug 2010 12:31:42 +0100
> *To: *HamsterofDeath
> *Cc: *Tony Morris;
> scala-user@listes.epfl.ch
> *Subject: *Re: [scala-user] performance question
>
> Unit doesn't actually have a forEach method, so your next best bet is
> probably Option - should be pretty speedy :)
>
> On 14 August 2010 12:27, HamsterofDeath > wrote:
>
> i cannot deduce what you intended with that response
>
> Am 14.08.2010 13:11, schrieb Tony Morris:
> > scala.Unit
> >
> > HamsterofDeath wrote:
> >> which of the collections has the fastest foreach?
> >>
> >>
>
>
>
>
Sat, 2010-08-14, 13:07
#7
Re: performance question
On Sat, Aug 14, 2010 at 1:40 PM, Andrew Milkowski <andrewmilkowski@gmail.com> wrote:
It would be really funny if Unit had the forEach method returning Unit:)
object Unit {
def foreach(f: (Unit) => Unit): Unit = f(this)
}
Side-effect heaven.
Sent from my Verizon Wireless BlackBerry
From: Kevin Wright <kev.lee.wright@gmail.com> Date: Sat, 14 Aug 2010 12:31:42 +0100To: HamsterofDeath<h-star@gmx.de>Cc: Tony Morris<tonymorris@gmail.com>; scala-user@listes.epfl.ch<scala-user@listes.epfl.ch> Subject: Re: [scala-user] performance question
Unit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star@gmx.de> wrote:
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Sat, 2010-08-14, 13:27
#8
Re: performance question
ok, let me ask it this way:
array, list or hashset?
Am 14.08.2010 13:31, schrieb Kevin Wright:
array, list or hashset?
Am 14.08.2010 13:31, schrieb Kevin Wright:
_6kgXpLTDqunPY66N+aFTyyJwDCcnjecBz+5g [at] mail [dot] gmail [dot] com" type="cite">Unit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star [at] gmx [dot] de" rel="nofollow">h-star@gmx.de> wrote:
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
--
Kevin Wright
mail/google talk: kev [dot] lee [dot] wright [at] gmail [dot] com" rel="nofollow">kev.lee.wright@gmail.com
wave: kev [dot] lee [dot] wright [at] googlewave [dot] com" rel="nofollow">kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sat, 2010-08-14, 14:37
#9
Re: performance question
Or Buffer, or Vector, or LinearSeq...
My guess would be Array (at least until the 2.9 parallel collections come out), but if you have a genuine need to micro-optimise at this level - use a profiler.
On 14 August 2010 13:26, HamsterofDeath <h-star@gmx.de> wrote:
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
My guess would be Array (at least until the 2.9 parallel collections come out), but if you have a genuine need to micro-optimise at this level - use a profiler.
On 14 August 2010 13:26, HamsterofDeath <h-star@gmx.de> wrote:
ok, let me ask it this way:
array, list or hashset?
Am 14.08.2010 13:31, schrieb Kevin Wright:Unit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star@gmx.de> wrote:
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sat, 2010-08-14, 15:47
#10
Re: performance question
the profilter told me that i should either use a faster foreach, or
solve the problem in a different way, and i was wondering if
swiching the collection type could give me a speed boost
Am 14.08.2010 15:34, schrieb Kevin Wright:
Am 14.08.2010 15:34, schrieb Kevin Wright:
aqb66wPBnysWWcEhtTS2K0ON4cwCXwBf5RR8w [at] mail [dot] gmail [dot] com" type="cite">Or Buffer, or Vector, or LinearSeq...
My guess would be Array (at least until the 2.9 parallel collections come out), but if you have a genuine need to micro-optimise at this level - use a profiler.
On 14 August 2010 13:26, HamsterofDeath <h-star [at] gmx [dot] de" rel="nofollow">h-star@gmx.de> wrote:
ok, let me ask it this way:
array, list or hashset?
Am 14.08.2010 13:31, schrieb Kevin Wright:Unit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star [at] gmx [dot] de" target="_blank" rel="nofollow">h-star@gmx.de> wrote:
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
--
Kevin Wright
mail/google talk: kev [dot] lee [dot] wright [at] gmail [dot] com" target="_blank" rel="nofollow">kev.lee.wright@gmail.com
wave: kev [dot] lee [dot] wright [at] googlewave [dot] com" target="_blank" rel="nofollow">kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
--
Kevin Wright
mail/google talk: kev [dot] lee [dot] wright [at] gmail [dot] com" rel="nofollow">kev.lee.wright@gmail.com
wave: kev [dot] lee [dot] wright [at] googlewave [dot] com" rel="nofollow">kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sat, 2010-08-14, 15:57
#11
Re: performance question
On Sat, Aug 14, 2010 at 4:44 PM, HamsterofDeath <h-star@gmx.de> wrote:
the profilter told me that i should either use a faster foreach, or solve the problem in a different way, and i was wondering if swiching the collection type could give me a speed boostUsing anything that extends IndexedSeq, and a "val len = seq.length; var i = 0; while(i < len) { doStuff(seq(i)); i += 1 }" will be the fastest thing you can get until parallel collections arrive.
Sat, 2010-08-14, 18:17
#12
Re: performance question
While loops with arrays are fastest. I haven't specifically tested all of the other collections, but WrappedArray and other things backed by a single array are going to be the fastest things in the collections hierarchy. Unfortunately, the immutable collections are slower because either they do pointer-chasing (lists) or have multiple levels (vector).
Also, make sure it's not boxing/unboxing which is the problem. The biggest penalties I've run into are usually when using primitives that need to be boxed. In contrast to that, the overhead of the foreach loop is usually minimal.
--Rex
On Sat, Aug 14, 2010 at 10:44 AM, HamsterofDeath <h-star@gmx.de> wrote:
Also, make sure it's not boxing/unboxing which is the problem. The biggest penalties I've run into are usually when using primitives that need to be boxed. In contrast to that, the overhead of the foreach loop is usually minimal.
--Rex
On Sat, Aug 14, 2010 at 10:44 AM, HamsterofDeath <h-star@gmx.de> wrote:
the profilter told me that i should either use a faster foreach, or solve the problem in a different way, and i was wondering if swiching the collection type could give me a speed boost
Am 14.08.2010 15:34, schrieb Kevin Wright:Or Buffer, or Vector, or LinearSeq...
My guess would be Array (at least until the 2.9 parallel collections come out), but if you have a genuine need to micro-optimise at this level - use a profiler.
On 14 August 2010 13:26, HamsterofDeath <h-star@gmx.de> wrote:
ok, let me ask it this way:
array, list or hashset?
Am 14.08.2010 13:31, schrieb Kevin Wright:Unit doesn't actually have a forEach method, so your next best bet is probably Option - should be pretty speedy :)
On 14 August 2010 12:27, HamsterofDeath <h-star@gmx.de> wrote:
i cannot deduce what you intended with that response
Am 14.08.2010 13:11, schrieb Tony Morris:
> scala.Unit
>
> HamsterofDeath wrote:
>> which of the collections has the fastest foreach?
>>
>>
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sat, 2010-08-14, 19:27
#13
Re: performance question
Have you tried compiling with -optimise? If you're lucky. It will inline your iteration, or at least at one time this was true. In any case, that can give the JIT a head start.
On Aug 14, 2010 10:44 AM, "HamsterofDeath" <h-star@gmx.de> wrote:
the profilter told me that i should either use a faster foreach, or solve the problem in a different way, and i was wondering if swiching the collection type could give me a speed boost
Am 14.08.2010 15:34, schrieb Kevin Wright:
>
> Or Buffer, or Vector, or LinearSeq...
>
> My guess would be Array (at least until the 2.9 paral...
Mon, 2010-08-16, 07:37
#14
Re: performance question
On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris <tonymorris@gmail.com> wrote:
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
Mon, 2010-08-16, 08:57
#15
Re: performance question
Oh goody car comparisons, seems we're on /. instead of the scala mailing list :)
But anyway, this is not like asking for the nearest gas station, because that would be unambiguous question.
The same can be said for the OP's question, it's just not clear what he wants, it's like asking "what's the best car?".
Best in what way? There's an almost infinite amount of possible correct answers.
Thing is I guess is that nobody fell like pointing out to him that he was giving way too little information to be able to expect an answer.
(and writing a one-liner almost demanding an answer doesn't help either I guess)
-Tako
On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich <elazarl@gmail.com> wrote:
But anyway, this is not like asking for the nearest gas station, because that would be unambiguous question.
The same can be said for the OP's question, it's just not clear what he wants, it's like asking "what's the best car?".
Best in what way? There's an almost infinite amount of possible correct answers.
Thing is I guess is that nobody fell like pointing out to him that he was giving way too little information to be able to expect an answer.
(and writing a one-liner almost demanding an answer doesn't help either I guess)
-Tako
On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich <elazarl@gmail.com> wrote:
On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris <tonymorris@gmail.com> wrote:
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
Tue, 2010-08-17, 21:07
#16
Re: performance question
You mean it's like asking what's the fastest car?
On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus <scala@codejive.org> wrote:
On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus <scala@codejive.org> wrote:
Oh goody car comparisons, seems we're on /. instead of the scala mailing list :)
But anyway, this is not like asking for the nearest gas station, because that would be unambiguous question.
The same can be said for the OP's question, it's just not clear what he wants, it's like asking "what's the best car?".
Best in what way? There's an almost infinite amount of possible correct answers.
Thing is I guess is that nobody fell like pointing out to him that he was giving way too little information to be able to expect an answer.
(and writing a one-liner almost demanding an answer doesn't help either I guess)
-Tako
On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich <elazarl@gmail.com> wrote:On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris <tonymorris@gmail.com> wrote:
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
Tue, 2010-08-17, 22:37
#17
Re: performance question
More like asking what's the fastest vehicle, but without specifying the cargo or how far it has to travel.
On 17 August 2010 20:58, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
On 17 August 2010 20:58, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
You mean it's like asking what's the fastest car?
On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus <scala@codejive.org> wrote:
Oh goody car comparisons, seems we're on /. instead of the scala mailing list :)
But anyway, this is not like asking for the nearest gas station, because that would be unambiguous question.
The same can be said for the OP's question, it's just not clear what he wants, it's like asking "what's the best car?".
Best in what way? There's an almost infinite amount of possible correct answers.
Thing is I guess is that nobody fell like pointing out to him that he was giving way too little information to be able to expect an answer.
(and writing a one-liner almost demanding an answer doesn't help either I guess)
-Tako
On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich <elazarl@gmail.com> wrote:On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris <tonymorris@gmail.com> wrote:
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Tue, 2010-08-17, 22:57
#18
Re: performance question
But supplying color of the vehicle:) (couldn't help:)
More like asking what's the fastest vehicle, but without specifying the cargo or how far it has to travel.
On 17 August 2010 20:58, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Sent from my Verizon Wireless BlackBerry
From: Kevin Wright <kev.lee.wright@gmail.com> Date: Tue, 17 Aug 2010 22:35:18 +0100To: Naftoli Gugenheim<naftoligug@gmail.com>Cc: Tako Schotanus<scala@codejive.org>; scala-user@listes.epfl.ch<scala-user@listes.epfl.ch>Subject: Re: [scala-user] performance questionMore like asking what's the fastest vehicle, but without specifying the cargo or how far it has to travel.
On 17 August 2010 20:58, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
You mean it's like asking what's the fastest car?
On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus <scala@codejive.org> wrote:
Oh goody car comparisons, seems we're on /. instead of the scala mailing list :)
But anyway, this is not like asking for the nearest gas station, because that would be unambiguous question.
The same can be said for the OP's question, it's just not clear what he wants, it's like asking "what's the best car?".
Best in what way? There's an almost infinite amount of possible correct answers.
Thing is I guess is that nobody fell like pointing out to him that he was giving way too little information to be able to expect an answer.
(and writing a one-liner almost demanding an answer doesn't help either I guess)
-Tako
On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich <elazarl@gmail.com> wrote:On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris <tonymorris@gmail.com> wrote:
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Wed, 2010-08-18, 00:07
#19
Re: performance question
What would be the extra factors to consider in this case?
On Tue, Aug 17, 2010 at 5:35 PM, Kevin Wright <kev.lee.wright@gmail.com> wrote:
On Tue, Aug 17, 2010 at 5:35 PM, Kevin Wright <kev.lee.wright@gmail.com> wrote:
More like asking what's the fastest vehicle, but without specifying the cargo or how far it has to travel.
On 17 August 2010 20:58, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
You mean it's like asking what's the fastest car?
On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus <scala@codejive.org> wrote:
Oh goody car comparisons, seems we're on /. instead of the scala mailing list :)
But anyway, this is not like asking for the nearest gas station, because that would be unambiguous question.
The same can be said for the OP's question, it's just not clear what he wants, it's like asking "what's the best car?".
Best in what way? There's an almost infinite amount of possible correct answers.
Thing is I guess is that nobody fell like pointing out to him that he was giving way too little information to be able to expect an answer.
(and writing a one-liner almost demanding an answer doesn't help either I guess)
-Tako
On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich <elazarl@gmail.com> wrote:On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris <tonymorris@gmail.com> wrote:
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
Wed, 2010-08-18, 07:57
#20
Re: performance question
On Tue, Aug 17, 2010 at 11:47 PM, Andrew Milkowski <andrewmilkowski@gmail.com> wrote:
But supplying color of the vehicle:) (couldn't help:)
"Orkish psychic abilities filling in whatever gaps in engineering may be present, an effect the Orks themselves are generally unaware of, present most notably in the fact that "The red ones go faster", meaning that any vehicle, painted red, will move faster than other vehicles for no other reason than the Orks believe it to be so." - Wikipedia
Sent from my Verizon Wireless BlackBerry
From: Kevin Wright <kev.lee.wright@gmail.com> Date: Tue, 17 Aug 2010 22:35:18 +0100To: Naftoli Gugenheim<naftoligug@gmail.com>Cc: Tako Schotanus<scala@codejive.org>; scala-user@listes.epfl.ch<scala-user@listes.epfl.ch> Subject: Re: [scala-user] performance question
More like asking what's the fastest vehicle, but without specifying the cargo or how far it has to travel.
On 17 August 2010 20:58, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
You mean it's like asking what's the fastest car?
On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus <scala@codejive.org> wrote:
Oh goody car comparisons, seems we're on /. instead of the scala mailing list :)
But anyway, this is not like asking for the nearest gas station, because that would be unambiguous question.
The same can be said for the OP's question, it's just not clear what he wants, it's like asking "what's the best car?".
Best in what way? There's an almost infinite amount of possible correct answers.
Thing is I guess is that nobody fell like pointing out to him that he was giving way too little information to be able to expect an answer.
(and writing a one-liner almost demanding an answer doesn't help either I guess)
-Tako
On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich <elazarl@gmail.com> wrote:On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris <tonymorris@gmail.com> wrote:
I'm not sure what is so confusing about the response. It's a direct
answer to the question at hand.
- Do you know how can I get to the nearest gas station?- Yes, I do know that.
(that is, what was confusing about your response, is, that you were expected to deduce the OP was not looking for this answer, just like the above conversation. Person B answered technically person's A's questions. But everyone understands that person A was really asking where is the nearest gas station. Since obviously person A can't do much with the fact that person B knows where the nearest gas station is).
--
Kevin Wright
mail/google talk: kev.lee.wright@gmail.com
wave: kev.lee.wright@googlewave.com
skype: kev.lee.wright
twitter: @thecoda
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Thu, 2010-08-19, 15:27
#21
Re: performance question
i don't understand what one could have possibly misunderstood when i asked "which collected has the fastest foreach".
the question is so simple that i don't know how to explain it further.
there's a listbuffer, an arraybuffer, a hashset, a whatever, and i call foreach, and i just wanted to know which one, assuming all contain the same elements, need the least time for iterating and calling apply.
-------- Original-Nachricht --------
> Datum: Wed, 18 Aug 2010 08:52:44 +0200
> Von: Viktor Klang
> An: andrewmilkowski@gmail.com
> CC: Kevin Wright , Naftoli Gugenheim , Tako Schotanus , "scala-user@listes.epfl.ch"
> Betreff: Re: [scala-user] performance question
> On Tue, Aug 17, 2010 at 11:47 PM, Andrew Milkowski <
> andrewmilkowski@gmail.com> wrote:
>
> > But supplying color of the vehicle:) (couldn't help:)
>
>
> "Orkish psychic abilities filling in whatever gaps in engineering may be
> present, an effect the Orks themselves are generally unaware of, present
> most notably in the fact that "*The red ones go faster*", meaning that any
> vehicle, painted red, will move faster than other vehicles for no other
> reason than the Orks believe it to be so." -
> Wikipedia
>
>
> > Sent from my Verizon Wireless BlackBerry
> > ------------------------------
> > *From: * Kevin Wright
> > *Date: *Tue, 17 Aug 2010 22:35:18 +0100
> > *To: *Naftoli Gugenheim
> > *Cc: *Tako Schotanus; scala-user@listes.epfl.ch<
> > scala-user@listes.epfl.ch>
> > *Subject: *Re: [scala-user] performance question
> >
> > More like asking what's the fastest vehicle, but without specifying the
> > cargo or how far it has to travel.
> >
> > On 17 August 2010 20:58, Naftoli Gugenheim wrote:
> >
> >> You mean it's like asking what's the fastest car?
> >>
> >>
> >> On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus
> wrote:
> >>
> >>> Oh goody car comparisons, seems we're on /. instead of the scala
> mailing
> >>> list :)
> >>>
> >>> But anyway, this is not like asking for the nearest gas station,
> because
> >>> that would be unambiguous question.
> >>> The same can be said for the OP's question, it's just not clear what
> he
> >>> wants, it's like asking "what's the best car?".
> >>> Best in what way? There's an almost infinite amount of possible
> correct
> >>> answers.
> >>>
> >>> Thing is I guess is that nobody fell like pointing out to him that he
> was
> >>> giving way too little information to be able to expect an answer.
> >>> (and writing a one-liner almost demanding an answer doesn't help
> either I
> >>> guess)
> >>>
> >>> -Tako
> >>>
> >>>
> >>>
> >>> On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich
> wrote:
> >>>
> >>>> On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris
> wrote:
> >>>>
> >>>>>
> >>>>> I'm not sure what is so confusing about the response. It's a direct
> >>>>> answer to the question at hand.
> >>>>>
> >>>>
> >>>> - Do you know how can I get to the nearest gas station?
> >>>> - Yes, I do know that.
> >>>>
> >>>> (that is, what was confusing about your response, is, that you were
> >>>> expected to deduce the OP was not looking for this answer, just like
> the
> >>>> above conversation. Person B answered technically person's A's
> questions.
> >>>> But everyone understands that person A was really asking *where* is
> the
> >>>> nearest gas station. Since obviously person A can't do much with the
> fact
> >>>> that person B knows where the nearest gas station is).
> >>>>
> >>>>
> >>>
> >>
> >
> >
> > --
> > Kevin Wright
> >
> > mail/google talk: kev.lee.wright@gmail.com
> > wave: kev.lee.wright@googlewave.com
> > skype: kev.lee.wright
> > twitter: @thecoda
> >
> >
>
>
Thu, 2010-08-19, 15:37
#22
Re: performance question
On Thu, Aug 19, 2010 at 4:21 PM, Dennis Haupt <h-star@gmx.de> wrote:
i don't understand what one could have possibly misunderstood when i asked "which collected has the fastest foreach".Anything extending this
the question is so simple that i don't know how to explain it further.
there's a listbuffer, an arraybuffer, a hashset, a whatever, and i call foreach, and i just wanted to know which one, assuming all contain the same elements, need the least time for iterating and calling apply.
-------- Original-Nachricht --------
> Datum: Wed, 18 Aug 2010 08:52:44 +0200
> Von: Viktor Klang <viktor.klang@gmail.com>
> An: andrewmilkowski@gmail.com
> CC: Kevin Wright <kev.lee.wright@gmail.com>, Naftoli Gugenheim <naftoligug@gmail.com>, Tako Schotanus <scala@codejive.org>, "scala-user@listes.epfl.ch" <scala-user@listes.epfl.ch>
> Betreff: Re: [scala-user] performance question
> On Tue, Aug 17, 2010 at 11:47 PM, Andrew Milkowski <
> andrewmilkowski@gmail.com> wrote:
>
> > But supplying color of the vehicle:) (couldn't help:)
>
>
> "Orkish psychic abilities filling in whatever gaps in engineering may be
> present, an effect the Orks themselves are generally unaware of, present
> most notably in the fact that "*The red ones go faster*", meaning that any
> vehicle, painted red, will move faster than other vehicles for no other
> reason than the Orks believe it to be so." -
> Wikipedia<http://en.wikipedia.org/wiki/Ork_%28Warhammer_40,000%29>
>
>
> > Sent from my Verizon Wireless BlackBerry
> > ------------------------------
> > *From: * Kevin Wright <kev.lee.wright@gmail.com>
> > *Date: *Tue, 17 Aug 2010 22:35:18 +0100
> > *To: *Naftoli Gugenheim<naftoligug@gmail.com>
> > *Cc: *Tako Schotanus<scala@codejive.org>; scala-user@listes.epfl.ch<
> > scala-user@listes.epfl.ch>
> > *Subject: *Re: [scala-user] performance question
> >
> > More like asking what's the fastest vehicle, but without specifying the
> > cargo or how far it has to travel.
> >
> > On 17 August 2010 20:58, Naftoli Gugenheim <naftoligug@gmail.com> wrote:
> >
> >> You mean it's like asking what's the fastest car?
> >>
> >>
> >> On Mon, Aug 16, 2010 at 3:51 AM, Tako Schotanus
> <scala@codejive.org>wrote:
> >>
> >>> Oh goody car comparisons, seems we're on /. instead of the scala
> mailing
> >>> list :)
> >>>
> >>> But anyway, this is not like asking for the nearest gas station,
> because
> >>> that would be unambiguous question.
> >>> The same can be said for the OP's question, it's just not clear what
> he
> >>> wants, it's like asking "what's the best car?".
> >>> Best in what way? There's an almost infinite amount of possible
> correct
> >>> answers.
> >>>
> >>> Thing is I guess is that nobody fell like pointing out to him that he
> was
> >>> giving way too little information to be able to expect an answer.
> >>> (and writing a one-liner almost demanding an answer doesn't help
> either I
> >>> guess)
> >>>
> >>> -Tako
> >>>
> >>>
> >>>
> >>> On Mon, Aug 16, 2010 at 08:35, Elazar Leibovich
> <elazarl@gmail.com>wrote:
> >>>
> >>>> On Sat, Aug 14, 2010 at 1:55 PM, Tony Morris
> <tonymorris@gmail.com>wrote:
> >>>>
> >>>>>
> >>>>> I'm not sure what is so confusing about the response. It's a direct
> >>>>> answer to the question at hand.
> >>>>>
> >>>>
> >>>> - Do you know how can I get to the nearest gas station?
> >>>> - Yes, I do know that.
> >>>>
> >>>> (that is, what was confusing about your response, is, that you were
> >>>> expected to deduce the OP was not looking for this answer, just like
> the
> >>>> above conversation. Person B answered technically person's A's
> questions.
> >>>> But everyone understands that person A was really asking *where* is
> the
> >>>> nearest gas station. Since obviously person A can't do much with the
> fact
> >>>> that person B knows where the nearest gas station is).
> >>>>
> >>>>
> >>>
> >>
> >
> >
> > --
> > Kevin Wright
> >
> > mail/google talk: kev.lee.wright@gmail.com
> > wave: kev.lee.wright@googlewave.com
> > skype: kev.lee.wright
> > twitter: @thecoda
> >
> >
>
>
> --
> Viktor Klang,
> Code Connoisseur
> Work: www.akkasource.com
> Code: github.com/viktorklang
> Follow: twitter.com/viktorklang
> Read: klangism.tumblr.com
--
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 ¿/mtl.!*
http://portal.gmx.net/de/go/dsl
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Thu, 2010-08-19, 16:37
#23
Re: performance question
On Thursday August 19 2010, Dennis Haupt wrote:
> i don't understand what one could have possibly misunderstood when i
> asked "which collected has the fastest foreach". the question is so
> simple that i don't know how to explain it further.
>
> there's a listbuffer, an arraybuffer, a hashset, a whatever, and i
> call foreach, and i just wanted to know which one, assuming all
> contain the same elements, need the least time for iterating and
> calling apply.
You shouldn't have done that. I don't think the answer is the same for
the lowest-overhead for iterating and the lostest-cost invocation of
apply(...).
Randall Schulz
Sun, 2010-08-22, 06:27
#24
Re: performance question
Performance Characteristics (from the What's New / Collections API article)
scala.Unit
HamsterofDeath wrote:
> which of the collections has the fastest foreach?
>
>