Re: [PHP] serializing result sets or what?

2005-09-28 Thread Rasmus Lerdorf
> A very similar question was asked recently on this list. You might like 
> to consider caching whatever you create from those result sets rather 
> than the result sets themselves, but APC [1] is worth looking at as I 
> believe it can cache (some?) PHP vars without serialisation, using 
> apc_store() and apc_fetch().

Everything except objects.  That also means if you have a nested array 
containing objects, it will have problems.  Right now you have to serialize
the object yourself if you want to cache it, but I will add code soon to do
that automatically internally.

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] serializing result sets or what?

2005-09-28 Thread Jake Gardner
"You may download this PECL extension DLL from the PHP Downloads page
or at http://snaps.php.net/.

Note: On Windows, APC expects c:\tmp to exist, and be writable by the
web server."



On 9/28/05, Thomas <[EMAIL PROTECTED]> wrote:
> Thanks, that looks good. But what do I do if OS is WinDoze? The install of
> the pecl only gives a .so *feeling sorry not everything runs on xp* ...
>
> I will take the time to benchmark the serializing vs db calls ... is there a
> good benchmark tool out there (without having to use microtime inside the
> scripts)?
>
> Thanks
>
> T
>
> -Original Message-
> From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED]
> Sent: 28 September 2005 11:41 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] serializing result sets or what?
>
> Thomas wrote:
> > Q: What would be the best way to save db calls for large result sets?
> >
> > I thought about serializing the data and then caching it (with Cache_Lite
> -
> > maybe there will be a future inclusion of such a caching scheme into the
> php
> > core or pecl?). I was not sure about performance though (no time for
> > benchmarking this).
> >
> > The issue is that as this system grows we get 2 - 3 db calls on the server
> > (which is too much in my opinion), but will serializing be cheaper or
> simply
> > the lesser of two evils?
>
> A very similar question was asked recently on this list. You might like
> to consider caching whatever you create from those result sets rather
> than the result sets themselves, but APC [1] is worth looking at as I
> believe it can cache (some?) PHP vars without serialisation, using
> apc_store() and apc_fetch().
>
> The only way to know whether such a scheme would help in your specific
> situation is to benchmark. Go on, it won't take long!
>
> [1] http://php.net/apc
> --
> Jasper Bryant-Greene
> Freelance web developer
> http://jasper.bryant-greene.name/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] serializing result sets or what?

2005-09-28 Thread Thomas
Thanks, that looks good. But what do I do if OS is WinDoze? The install of
the pecl only gives a .so *feeling sorry not everything runs on xp* ...

I will take the time to benchmark the serializing vs db calls ... is there a
good benchmark tool out there (without having to use microtime inside the
scripts)?

Thanks

T

-Original Message-
From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] 
Sent: 28 September 2005 11:41 AM
To: php-general@lists.php.net
Subject: Re: [PHP] serializing result sets or what?

Thomas wrote:
> Q: What would be the best way to save db calls for large result sets? 
> 
> I thought about serializing the data and then caching it (with Cache_Lite
-
> maybe there will be a future inclusion of such a caching scheme into the
php
> core or pecl?). I was not sure about performance though (no time for
> benchmarking this).
> 
> The issue is that as this system grows we get 2 - 3 db calls on the server
> (which is too much in my opinion), but will serializing be cheaper or
simply
> the lesser of two evils?

A very similar question was asked recently on this list. You might like 
to consider caching whatever you create from those result sets rather 
than the result sets themselves, but APC [1] is worth looking at as I 
believe it can cache (some?) PHP vars without serialisation, using 
apc_store() and apc_fetch().

The only way to know whether such a scheme would help in your specific 
situation is to benchmark. Go on, it won't take long!

[1] http://php.net/apc
-- 
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] serializing result sets or what?

2005-09-28 Thread Jasper Bryant-Greene

Thomas wrote:
Q: What would be the best way to save db calls for large result sets? 


I thought about serializing the data and then caching it (with Cache_Lite -
maybe there will be a future inclusion of such a caching scheme into the php
core or pecl?). I was not sure about performance though (no time for
benchmarking this).

The issue is that as this system grows we get 2 - 3 db calls on the server
(which is too much in my opinion), but will serializing be cheaper or simply
the lesser of two evils?


A very similar question was asked recently on this list. You might like 
to consider caching whatever you create from those result sets rather 
than the result sets themselves, but APC [1] is worth looking at as I 
believe it can cache (some?) PHP vars without serialisation, using 
apc_store() and apc_fetch().


The only way to know whether such a scheme would help in your specific 
situation is to benchmark. Go on, it won't take long!


[1] http://php.net/apc
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] serializing result sets, or what?

2005-09-28 Thread Thomas

Hi,

Having spent a little time on Google (and reading unrelated articles ...) I
would like post my question here again (as advice on the list is always very
valuable indeed!): 

Q: What would be the best way to save db calls for large result sets? 

I thought about serializing the data and then caching it (with Cache_Lite -
maybe there will be a future inclusion of such a caching scheme into the php
core or pecl?). I was not sure about performance though (no time for
benchmarking this).

The issue is that as this system grows we get 2 - 3 db calls on the server
(which is too much in my opinion), but will serializing be cheaper or simply
the lesser of two evils?

Thanks already (as top posting is a sin) for your replies ...

T


SPIRAL EYE STUDIOS
P.O. Box 37907, Faerie Glen, 0043

Tel: +27 12 362 3486
Fax: +27 12 362 3493
Mobile: +27 82 442 9228
Email: [EMAIL PROTECTED]
Web: www.spiraleye.co.za 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] serializing result sets or what?

2005-09-28 Thread Thomas

Hi,

Having spent a little time on Google (and reading unrelated articles ...) I
would like post my question here again (as advice on the list is always very
valuable indeed!): 

Q: What would be the best way to save db calls for large result sets? 

I thought about serializing the data and then caching it (with Cache_Lite -
maybe there will be a future inclusion of such a caching scheme into the php
core or pecl?). I was not sure about performance though (no time for
benchmarking this).

The issue is that as this system grows we get 2 - 3 db calls on the server
(which is too much in my opinion), but will serializing be cheaper or simply
the lesser of two evils?

Thanks already (as top posting is a sin) for your replies ...

T


SPIRAL EYE STUDIOS 
P.O. Box 37907, Faerie Glen, 0043

Tel: +27 12 362 3486
Fax: +27 12 362 3493 
Mobile: +27 82 442 9228
Email: [EMAIL PROTECTED]
Web: www.spiraleye.co.za 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php