microsoft / tiny-calc

Tiny expression evaluator
MIT License
39 stars 9 forks source link

Nano: Updates to Map/Vector/Matrix interfaces #61

Closed DLehenbauer closed 4 years ago

DLehenbauer commented 4 years ago

Remove 'values' from change notification interfaces

The original thinking behind including an array of changed 'values' was that we would just pass these through from the op performing the insert/remove/set (i.e., it would be convenient & zero-alloc.)

In practice, I'm not finding it useful as we scale up and recalculation is increasingly done in batches / lazily as the consumer pulls.

It's also becoming increasingly rare that we happen to have a 'values' array handy. It's usually convenient to set vector items / matrix cells point-wise (i.e., using setCell vs. setCells) vs. creating an array to set multiple values simulateously.

Also, as we look at scaling up, it's likely that remote ops will no longer carry the values.

Rename IReader.read() -> IReader.get*()

Two changes:

Use count/start suffixes when specifying intervals / 2D regions

Minor Intellisense improvement (typing .row will show '.rowCount', '.rowStart', etc.)

DLehenbauer commented 4 years ago

Applies the subset of changes discussed in issue #58 that I felt pretty confident about... but I am still open to feedback.

jack-williams commented 4 years ago

All looks good!