Dan Rusu

Results 36 comments of Dan Rusu

Using the `data` keyword for `object ` declarations seems inconsistent and misleading because the behavior differs from our mental model of data classes. Inconsistencies: 1. The `copy` method is not...

> 3 & 5 are not really relevant as the generated version would be functionally equivalent to the default implementation... > > You could also argue that 2 does occur....

> what about extracting a receiver function for `.trimMargin().replace("\n", System.lineSeparator())`? I could extract a `trimMarginWithSystemLineEndings()` extension function as long as I have a place to put it that's accessible by...

> I was wondering if it would make sense to have Strikt's assertions be lenient about (or normalize) line separators rather than changing all the assertions I think that precise...

An alternative approach would be to have 2 measurement stacks, one for arrays and the other for regular objects so the logic would look something like this: ``` while (arrayStack.isNotEmpty()...

To clarify, when encountering an array with N eligible elements, Jamm currently makes 2N copies. Inside the MeasurementStack, all the array element references get copied to the tracker, and another...

@blerer there seems to be a misunderstanding here as this has nothing to do with the Java memory model. Yes, when first encountering an array field, a reference to that...

The **MemoryMeter.Builder** could have a flag that controls caching with a default of false. When enabled, it would select the MemoryMeterStrategy as usual and wrap it in the fairly trivial...

Thanks, I tried it out in my project (using Kotlin): ```kotlin class CachedMemoryMeterStrategy( val backingStrategy: MemoryMeterStrategy ) : MemoryMeterStrategy by backingStrategy { private val cache = ConcurrentHashMap() override fun measure(entity:...

Created a separate topic for measuring array elements much more efficiently: https://github.com/jbellis/jamm/issues/66 Once that's implemented, I expect the improvements from caching to become more pronounced as the array overhead is...