NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Reason to use NuSphere Encoder instead of others?


Joined: 15 Jan 2010
Posts: 3
Reply with quote
I'm trying to decide on which Php Encoder/Licensing software to use and basically it's seems to be between NuSphere and one other software, unnamed since the TOS doesn't allow talking about third party software.

I like the fact NuSphere has a bunch of other software that we might decide to buy and use subsequently. But the key thing is the encoder/loader for the moment. However, there doesn't seem to be any recent comparison between NuSphere and other encoder/loaders so I'd like to get some user opinions on the reasons why they went with NuSphere Encoder.

Please pardon me if this is not the correct sub-forum for this kind of questions and in that case, please help shift this to the correct place, thank you.
View user's profileFind all posts by EmmanuelSend private message


Joined: 16 Jul 2009
Posts: 15
Reply with quote
Hi Emmanuel,

I'm currently using Nucoder, not because of execution speed but of the licencing features.
I made this test, to check if the promissed performance boost will appear:

PHP 5.2.12 with latest PHPExpress-Version and nucoder.


Code:

$loops = $argv[1]; 
  $i = 0;
  $in = 0;           
  $start = time();   
  while($i < $loops) {   
    $x = mt_rand(1,1000) / 1000;
    $y = mt_rand(1,1000) / 1000;
    $c = sqrt(pow($x,2) + pow($y,2));
    if($c <= 1) {
      $in++;
    }
    $i++;         
  }
  echo ($in/$loops * 4)."\n\n";
  echo time() - $start;


pure php with 10.000.000 loops: 38 sec.
encoded php with 10.000.000 loops: 53 sec.

I don't know where this difference comes from, maybe somebody knows where the problem is.
Maybe you can varify my results (with the trial version).

I've encoded the file with follwing cmd:
Code:
nu-coder.exe -f mc.php mc-e.php
View user's profileFind all posts by vvbSend private message


Joined: 15 Jan 2010
Posts: 3
Reply with quote
You're trying to check performance in a small loop with instructions that are probably already highly optimized in PHP itself. So there probably isn't any further optimization any encoder can do for that kind of code. Very Happy
View user's profileFind all posts by EmmanuelSend private message


Joined: 16 Jul 2009
Posts: 15
Reply with quote
in this case, i didn't expect any optimization, but at least the same runtime. the difference are 15 sec.!
View user's profileFind all posts by vvbSend private message


Joined: 15 Jan 2010
Posts: 3
Reply with quote
vvb wrote:
in this case, i didn't expect any optimization, but at least the same runtime. the difference are 15 sec.!


How about timing each particular operation instead of together? e.g.

Code:

$loops = $argv[1];
$x=array();
$y=array();
  $i = 0;
  $in = 0;           
  $start1 = time();   
  while($i < $loops) {   
    $x[$i] = mt_rand(1,1000) / 1000;
    $y[$i] = mt_rand(1,1000) / 1000;
    $i++;         
  }
  $start2= time();

  foreach ($x as $k=>$v) {
    $c = sqrt(pow($v,2) + pow($y[$k],2));
    if($c <= 1) {
      $in++;
    }

  $end=time();

  echo ($in/$loops * 4)."\n\n";

  echo 'MtRand time :',  $start2 - $start1, 'sqrt & pow time: ', $end - $start2;


I've not tested it, just writing adlib but I think you will get what I am trying to achieve? Very Happy
View user's profileFind all posts by EmmanuelSend private message


Joined: 05 Oct 2008
Posts: 31
Reply with quote
I am certainly no expert on this topic, but I think that it is only logical that scripts would run slower, which has also been my consistent experience. After all, there is probably an additional decoding step and the decoded scripts are interpreted by the same PHP engine. Maybe the files would have a smaller footprint on the server that could load them faster?

As far as the main topic was concerned, the main reason for using NuCoder is its ease of use and tight integration with PhpED.

The main reason for not using it would be the long time it is taking to add support for PHP 5.3.
View user's profileFind all posts by NphpMSend private message


Joined: 18 May 2006
Posts: 61
Reply with quote
Seems you did something wrong. According to my test, there is absolutely no change in the performance. See the results:



The difference of 1 sec reflects the precision of the test itself.

The files I tested are available from the link below: http://www.nusphere.com/sshot/55tst.zip

If you want to check the performance improvements brought by PhpExpress, test complete applications,
like Drupal-driven web site or something like that and you'll see from 130% to 240% speedup in average (I checked with Apache's ab).
View user's profileFind all posts by mdegtyarevSend private message
Reason to use NuSphere Encoder instead of others?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic