Guest Posted December 18, 2007 Share Posted December 18, 2007 Hi, I'm getting into optimization, and I'm exploring migrating all I/O operations from flat files to shared memory. But I'm new at using PHP for this. I checked out the documentation, googled it, found lots of good info, but more help would be appreciated: 1) are PHP's shmop_* functions binary safe? 2) Can I store a resource in shared memory? Particularly image resources? (I know, I know, just output the binary and put it in shared mem, hence question #1) 3) Shared memory is persistant, and logically, it is persistent across all users on this server. Correct? Yes, stupid question, but I don't want to find out the hard way that PHP has some kind of psuedo shared memory layer that isn't true shared memory or... er... yea... Making no sense? Yea, no excuse. For some reason, I want to be assured that I'm sane ANOTHER THING: Among other things, one thing I'm trying to do is speed up this monster image resizing script (does other things too). It easily goes through 10,000+ images that vary between 100x100 to 8000x8000 (and there's a risk that may grow, yikes). Now obviously, this means aggressive garbage collection after each image, but is there any way to chop a resource into pieces, and combine the result after? Or aggressive garbage collection during image operations? Obviously, I can't open the image resource without eating up hell's worth of ram, so maybe this isn't something I can do in PHP (C, if I must). I have thought of reading the file with fopen and fread and writing it into 3 seperate jpgs and resizing them individually, but doubt it'd work for obvious reasons. Any suggestions? Obviously I've been using obvious too much! But, alright! That's all on my sleep-deprived mind! hehe, all input is appreciated! Quote Link to comment Share on other sites More sharing options...
Guest Posted December 19, 2007 Share Posted December 19, 2007 bump. Any help? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.