react-native-onyx icon indicating copy to clipboard operation
react-native-onyx copied to clipboard

Remove null values from cache to improve Onyx read speed

Open chrispader opened this issue 1 year ago • 2 comments

In https://github.com/Expensify/react-native-onyx/pull/411 we changed code in Onyx to persist null values in cache, in order for the user to know, that a value has been accessed before but there's no value.

This fixed an issue here but apperantly isn't the perfect solution, since it requires us to remove null values on read, as implemented in https://github.com/Expensify/react-native-onyx/pull/519.

This PR removes null values from cache and removes calls to removeNestedNullValues on read. Instead, null values are only going to be removed on write (e.g. Onyx.merge/Onyx.set).

This should speed up read speeds by a lot, since it prevents the problem described in https://expensify.slack.com/archives/C05LX9D6E07/p1716395008375049?thread_ts=1716303470.244179&cid=C05LX9D6E07

chrispader avatar May 24 '24 10:05 chrispader

asked for status update on this here

https://expensify.slack.com/archives/C05LX9D6E07/p1717540938581599

kevinksullivan avatar Jun 04 '24 22:06 kevinksullivan

As described by @mountiny in https://expensify.slack.com/archives/C05LX9D6E07/p1717542026961829?thread_ts=1717540938.581599&cid=C05LX9D6E07, working on shipping this in the current Onyx bump PR

chrispader avatar Jun 05 '24 07:06 chrispader

This can be closed

muttmuure avatar Jul 31 '24 15:07 muttmuure