The Artima Developer Community
Sponsored Link

Articles Forum
What's New in Scala 2.8: Collections API

16 replies on 2 pages. Most recent reply: Sep 1, 2010 7:33 AM by michael lawley

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 16 replies on 2 pages [ « | 1 2 ]
Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: What's New in Scala 2.8: Collections API Posted: Sep 1, 2010 5:04 AM
Reply to this message Reply
Advertisement
> I have timed immmutable/persistent collections against
> regular ones and found the immutable collections
> significantly slower for basic operations. However this
> isn't representative of how you would normally use the
> immutable collections. In particular it doesn't account
> for time saved by not having to copy a collection. You can
> thus only assess overall performance in the context of a
> specific real application.
>
> In my work I often make a complex set of changes to a set
> of data and then assess whether the result is acceptable
> (feasible). If it isn't feasible, then the changes have to
> be reversed. If the data set as a whole is immutable, then
> that undo is achieved by simply keeping a reference to its
> previous state. With mutable data structures you either
> make a complete copy or actually perform the undo
> operations, in either case at significant cost in CPU
> and/or code complexity.

As you say, it all depends on the application. If the data change a lot, then it makes sense to modify a copy of them. If only a small subset of the data changes, it's better for performance reasons to just keep the changes and change the original data (assuming we are talking about data sizes that can visibly affect performance).

michael lawley

Posts: 2
Nickname: lawley
Registered: Dec, 2007

Re: What's New in Scala 2.8: Collections API Posted: Sep 1, 2010 7:33 AM
Reply to this message Reply
It's really nice to see the tables documenting performance characteristics on the linked page:
http://lampwww.epfl.ch/~odersky/whatsnew/collections-api/collections_40.html

But...my application is very sensitive to memory consumption; many kinds of Maps and Map-like structures, some dense, some sparse. The Java Collection classes are extremely memory hungry. It would be really nice to see the memory-performance of the various implementations documented too.

michael

Flat View: This topic has 16 replies on 2 pages [ « | 1  2 ]
Topic: What's New in Scala 2.8: Chained Package Clauses Previous Topic   Next Topic Topic: Skinning Components in Flex 4

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use