These are chat archives for dry-rb/chat

21st
Jun 2017
Piotr Solnica
@solnic
Jun 21 2017 20:13
@backus @flash-gordon do you know any reason why this is not memoized?
it's actually a significant bottleneck in rom heh
John Backus
@backus
Jun 21 2017 20:15
haha
I don't know off the top of my head
Nikita Shilnikov
@flash-gordon
Jun 21 2017 20:15
shit :see_no_evil:
John Backus
@backus
Jun 21 2017 20:15
but I do know that this dry struct schema thing is by far the most churned part of the project
so be careful :P
Piotr Solnica
@solnic
Jun 21 2017 20:17
maybe it's meant to be called just once, constructor is memoized IIRC
I was trying to write a custom new for rom structs and I used schema there and it was a bottleneck
John Backus
@backus
Jun 21 2017 20:18
Yeah basically it all comes down to inheritance so I think as long as you can have like MyAdmin < User < Dry::Value < Dry::Struct and like change the constructor types and attributes in user and my admin
Nikita Shilnikov
@flash-gordon
Jun 21 2017 20:18
@solnic I think it was meant, then IIRC I refactored the inherited hook and we've got this
John Backus
@backus
Jun 21 2017 20:18
then you are probably fine
tests were added for each change so probably fine to experiment with memoizing it
Nikita Shilnikov
@flash-gordon
Jun 21 2017 20:23
@solnic input is memoized already but since schema is called not only here we need to memoize it too
@solnic I'm gonna do it today, is it fine?
Piotr Solnica
@solnic
Jun 21 2017 20:48
I'm 99.9% sure it's gonna be fine