What are the benefits of various PHP compression libraries?

I was looking for ways to compress PHP libraries, and I found several libraries that might be useful, but I really know little about them.

I specifically read about the bcompiler and PHAR libraries. Is there any performance advantage? Are there any "sweeps" that I should keep track of? What are the relative benefits? Can any of them add / distract performance?

I am also interested in exploring other libraries that may be there that are not obvious in the documentation?

In any case, does anyone happen to know if they work more like zip files that just have code there, or if they work more like Python pre-compilation that actually runs the pseudo compiler?

========================= EDIT ========================== ===============================================

I was asked: "What are you trying to accomplish?" Well, I suppose the answer is this: all this is hypothetical. This is their combination:

  • What if my favorite project becomes the most popular web project on earth and I want to distribute it quickly and easily? (hay, a person can dream, right?) It also seems that if you can use PHAR easily, this will be the best way to create a subversion snapshot.
  • Python has this really cool pre-compilation policy, I wonder if PHP has anything like that? These libraries seem to do something similar. Will they do it?
  • Hey, these libraries seem pretty neat, but I would like to clarify the differences as they seem to do the same.
+2
source share
2 answers

Phar just packs a set of php scripts into a single file - the application can be launched without having to unpack it first. The phar point should not precompile (for speed) or compress (for space) the application, just to make it more distributed.

What are you trying to achieve? The size of the Script file is never a problem since Script does not go through the cable every time it is called. Speed โ€‹โ€‹can be decided by caching using something like Zend or precompiling using something like Hip Hop , which Facebook is running on.

+7
source

Php also has "precompiler" support, but this is called "bytecode cache." Using it eliminates the need for php to parse and compile .php files every time, and you really have to use everything wherever you run PHP applications.

Known examples are APC and eAccelerator .

+1
source

All Articles