User story #1285
closedImmutable case class hashcode caching
Description
The default hashCode implementation for case classes is a method. We can cache the result for mutable cache classes, which would give noticeable perf improvements during operations on HashSet/HashMap.
Ex: override lazy val hashCode(): Int = ScalaRunTime.this._hashCode(Foo.this);
=> Can also be generalized with something like "CachedHashCode":
@see: http://www.scala-lang.org/node/7930
The time estimation for this and a first iteration on non mutable classes is 1 hour, the remaining should be done afterwards.
Updated by François ARMAND over 13 years ago
- Estimated time changed from 2.00 h to 1.00 h
Trait implementation:
trait HashcodeCaching { self: Product => override lazy val hashCode: Int = { println("hashCode " + this); scala.runtime.ScalaRunTime._hashCode(this) } }
Thus, I leave only one estimated hour left so we can add it on needing case classes
Updated by Jonathan CLARKE over 13 years ago
- Category set to Architecture - Code maintenance
Updated by Jonathan CLARKE over 13 years ago
- Target version changed from 10 to 13
Updated by Jonathan CLARKE over 13 years ago
- Status changed from New to In progress
This issue is dedicated to the modification tracking about this. It will be updated to follow runs, and when done, just close it ;-)
Updated by Jonathan CLARKE over 13 years ago
- Tracker changed from Architecture to User story
Updated by François ARMAND over 13 years ago
- Target version changed from 13 to 14
- % Done changed from 0 to 30
Done for inventory.
Updated by Jonathan CLARKE over 13 years ago
- Target version changed from 14 to 15
Updated by Jonathan CLARKE over 13 years ago
- Target version changed from 15 to 16
Updated by Jonathan CLARKE over 13 years ago
- Target version changed from 16 to 19
Updated by Jonathan CLARKE over 13 years ago
- Target version changed from 19 to 21
Updated by Jonathan CLARKE over 13 years ago
- Target version changed from 21 to 23
Updated by Jonathan CLARKE about 13 years ago
- Target version changed from 23 to 18
Updated by François ARMAND about 13 years ago
- Target version changed from 18 to 2.4.0~alpha1
Updated by François ARMAND about 13 years ago
- Status changed from In progress to Pending technical review
- % Done changed from 30 to 100
Applied in changeset c0baea72c9e33730a2fc1869c16ed07435e3939a.
Updated by Nicolas CHARLES almost 13 years ago
- Status changed from Pending technical review to 10
This seems valid, i didn't find any case class left without the hashcode, but if any is found, we'll update this ticket
Updated by Jonathan CLARKE almost 13 years ago
- Status changed from 10 to Released
Updated by Matthieu CERDA almost 10 years ago
- Subject changed from Cache des hashcode de case classes immutable to Immutable case class hashcode caching
- Description updated (diff)