stress test of everywhere

21 views
Skip to first unread message

Sam Halliday

unread,
Feb 12, 2015, 12:03:02 PM2/12/15
to shapel...@googlegroups.com
Hi all,

I finally upgraded to shapeless-2.1 and converted a runtime object visitor to use `everywhere` instead.

I performed a stress test on 60GB of real data that was parsed from JSON with spray-json (there is no TypeClass for spray-json yet, so this is all with hand-crafted sealed trait handling) into a non-trivial domain model with recursive types and all sorts, performing a validation step in the `everywhere`.

The reflective code took 806s to complete, whereas everywhere took 792s. I consider this to be a negligible difference in time for the task - i.e. no serious regressions vs runtime - and in reality the bulk of the CPU time is spent on moving that 60GB around.

But **most importantly**, the results for using `everywhere` and my runtime reflection code yielded exactly the same results :smile:. So that gives me a lot of confidence in `everywhere`.

One thing that I was a little disappointed by was the lack of compile time warnings of the applicability of `everywhere`. It feels a little bit like we're giving up type safety because it s possible to list implicits inside the Poly1 that can provably never be called for some applications. It would be incredibly useful if the compiler was capable of throwing a warning under such circumstances: or maybe just if the entire poly was guaranteed to never be used.

Best regards,
Sam
Reply all
Reply to author
Forward
0 new messages