I was encountered with time wasting problem working with Orm query. Some of Model queries are fast enough, but one Model query is too slow. I tried to inspect where we waste the time and what difference between that one Model and any others. I found in that Model Orm\Observer_Typing is set and when I commented out this element I won up to 4 seconds on that query!
I thought the type casting acts only when Model saving, but now I execute some query()->get() (with some relations and where conditions). So it's reading operation. Why does type casting act here? Is it a bug?
This suggests you are doing bulk operations using the ORM, which isn't really suited for that, because of this, but also because the hydrating process and the fact all ORM objects are cached (i.e. kept in memory).
The idea behind it is that you can use it to convert a serialized array to an array on read, and serialize it again on write. Or an integer (which some drivers return as string) to an integer and back.