finom / use-change

The most minimalistic React state management library on the market with zero dependencies and React.useState-like syntax
MIT License
91 stars 2 forks source link

benchmarks? #2

Open japrescott opened 3 years ago

japrescott commented 3 years ago

I just came by this lib and I think its really nice and offers many possibilities. I would be interested in benchmarks comparing React.context and Redux with this lib. Any intention of adding some?

finom commented 3 years ago

Good idea!

finom commented 2 years ago

@japrescott do you have any good performance test so I can easily inject use-change test to make sure that I use proper set up of other libraries to avoid any potential manipulations from my side?

japrescott commented 2 years ago

@finom sadly I dont. I would recommend seeing uf redux or reacts useHooks have some benchmarks you can build upon

finom commented 2 years ago

@japrescott got it. For now take a look at the hook's code: https://github.com/finom/use-change/blob/main/src/useChange.ts#L18-L51 and https://github.com/finom/use-change/blob/main/src/listenChange.ts#L9-L27. It's quite minimalistic and uses a few hooks + Object.defineProperty, which means it should have quite good performance. But a performance demonstration definitely makes sense here.