# Unserialize()

- Thread: https://externals.io/message/15541
- Original archive: https://news-web.php.net/php.internals/15541
- Started by shruti on 2005-03-22T15:51:30+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #15541 — shruti — 2005-03-22T15:51:30+00:00

URL: https://externals.io/message/15541#15541

Hello all,
I have an issue with unserializing big objects. My object when serialized to a file creates a file as big as 29 Megs. And when i m trying to unserialize the object, it takes forever somewhere around 33-36 secs(sometimes even more).
 
My object has one member variable which is a reference to an array. 
 
I was using PHP5.0.2 I read about some bugfixes with unserialize. So I grabbed the most latest snapshot from CVS 5.0.4 RC4. (Dint help me though)
 
Alternately I also tried 
$s = "<? php $var = " . var_export(myobj.arr,true)  . " ?>";
and then writing this string to a cache file (Creates a file as big as 29Megs). 
Next time when the cache is found I say..require($cachefile);
and then use the $var to recreate myobj.
This also proved out to be too slow for me. Any comments on how should I handle this issue.
If you want i can send the code to you. Could you please help me on this?
 
Waiting for a reply eagerly,
Thanks a lot
 
Regards,
--shruti.


		
---------------------------------
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site!

---

## #15542 — Jochem Maas — 2005-03-22T16:29:22+00:00

URL: https://externals.io/message/15541#15542 · In reply to: #15541

shruti wrote:
> Hello all,
> I have an issue with unserializing big objects. My object when serialized to a file creates a file as big as 29 Megs. And when i m trying to unserialize the object, it takes forever somewhere around 33-36 secs(sometimes even more).
>  
> My object has one member variable which is a reference to an array. 
>  
> I was using PHP5.0.2 I read about some bugfixes with unserialize. So I grabbed the most latest snapshot from CVS 5.0.4 RC4. (Dint help me though)
>  
> Alternately I also tried 
> $s = "<? php $var = " . var_export(myobj.arr,true)  . " ?>";
> and then writing this string to a cache file (Creates a file as big as 29Megs). 
> Next time when the cache is found I say..require($cachefile);
> and then use the $var to recreate myobj.
> This also proved out to be too slow for me. Any comments on how should I handle this issue.
> If you want i can send the code to you. Could you please help me on this?

what is this object? what does it do? and why does it contain 29Megs of stuff?
_seems_ to me like the architecture is not right if the serialized object is 29 Megs.

>  
> Waiting for a reply eagerly,
> Thanks a lot
>  
> Regards,
> --shruti.
> 
> 
> 		
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Small Business - Try our new resources site!
