PHP Classes

You can optimize more, for more speed code reading?

Recommend this page to a friend!

      PHP Ghost Crypt  >  All threads  >  You can optimize more, for more...  >  (Un) Subscribe thread alerts  
Subject:You can optimize more, for more...
Summary:very slow to publish it to a production server
Messages:11
Author:jose carlos
Date:2015-11-16 13:50:38
 
  1 - 10   11 - 11  

  1. You can optimize more, for more...   Reply   Report abuse  
Picture of jose carlos jose carlos - 2015-11-16 13:50:38
Hello and good morning,
The truth that the encryption is very good. I like.
But I've posted encrypted php classes and the truth makes me very slowly, about three second reading.

Is it possible to expedite this?

  2. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2015-11-16 21:10:57 - In reply to message 1 from jose carlos
3 seconds is a looooooong time. I wouldn't expect it to take more than 5 milliseconds per line, so a file with 1000 lines would take 1/20th of a second.

I'll test some larger files and see what I get. If my estimation is correct, then your server may be throttling your access to resources.

I will have the results shortly.

Dave

  3. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2015-11-16 22:27:35 - In reply to message 2 from Dave Smith
Test results are in.

On average, it took .4 seconds to load 1000 lines of code typically found in a class file. So that is about 2,500 lines per second.

Not the best results, but I can live with them.

One thing you can do is minimize the number of lines you need to encrypt by having a main class of the secret stuff to encrypt and a class to extend it of the not secret stuff.

Then again, the author could try different encryption methods to find one that is not so resource heavy.

Dave

  4. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of jose carlos jose carlos - 2015-11-16 23:30:13 - In reply to message 3 from Dave Smith
Thank you very much Dave Smith,
Actually yes, it takes a while. They also could have the option to choose the type of encryption in low, medium and high.
Do you look good?

  5. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of Nick Daniels Nick Daniels - 2015-11-18 02:45:17 - In reply to message 3 from Dave Smith
I've sent you an update over email Dave :)

  6. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of Nick Daniels Nick Daniels - 2015-11-18 16:18:16 - In reply to message 4 from jose carlos
Hello Jose,

Please give the new updated code a wizz, you should be pleased with it's speed hopefully now.

phpclasses.org/package/9381-PHP-Enc ...

Regards, :)

  7. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of jose carlos jose carlos - 2015-11-18 22:47:01 - In reply to message 6 from Nick Daniels
OMG!!!

Now it goes well !! It's perfect!!
Thank you very much thank you, will you let the possibility to choose the type of ecriptacion?
Otherwise, the new function, to change the extension, has the possibility to overwrite the file. I mean, if I want the output file the same name as, would it be possible?

  8. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of Nick Daniels Nick Daniels - 2015-11-18 23:52:03 - In reply to message 7 from jose carlos
Hm, What do you mean by the below?

"will you let the possibility to choose the type of ecriptacion?"

Also, if you set the extension to a file with the same e.g. file.php for infile and outfile as .php would probably actually overwrite the file yes, but would you really want to do this?

By that I mean, at least check to see if you have an original copy, then a second copy, to which you'd then be encrypting/overwriting.

Unless I try it out, let me know if it works.

  9. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of jose carlos jose carlos - 2015-11-19 17:44:07 - In reply to message 8 from Nick Daniels
ok, perfect!!

But , $outFileExt variable, does not exist in the __contruct class. Can you check it?

  10. Re: You can optimize more, for more...   Reply   Report abuse  
Picture of Nick Daniels Nick Daniels - 2015-11-19 18:39:48 - In reply to message 9 from jose carlos
Hm, It should be, unless I updated with a messed up copy, :o

I'll check :)

 
  1 - 10   11 - 11