Skip to content

Conversation

sebpop
Copy link
Contributor

@sebpop sebpop commented May 3, 2019

The time goes from 0.175s down to 0.007s on a Graviton A1 instance on the
following benchmark:

function simple_crc32() {
  $a = "foo";
  for ($i = 0; $i < 10000; $i++) {
      crc32($a);
      $a .= "o";
  }
}

Copy link
Contributor

@peter279k peter279k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any reference about execution time benchmark?

@sebpop
Copy link
Contributor Author

sebpop commented May 3, 2019

I'm not sure what you are asking for, could you please be more specific?

The benchmark is a synthetic one that I run with the timing code from Zend/bench.php.

@peter279k
Copy link
Contributor

@sebpop, thank you for your reply.

I want to know where the reference presents about this performance issue.

@petk petk added the Feature label May 7, 2019
@sebpop
Copy link
Contributor Author

sebpop commented Jul 8, 2019

Is there anything that needs to be addressed in this change, or is it ok to commit?
Thanks!

@sebpop
Copy link
Contributor Author

sebpop commented Jul 10, 2019

I rebased the patch on master, and tested with make test.
I removed the alignment code from before the loop to reduce code size and no performance change.
@dstogov the patch is ready to be committed to master and php-7.4, thanks!

The time goes from 0.838s down to 0.029s (a 28x speedup) on a Graviton A1
instance and the following benchmark:

function simple_crc32() {
  $a = "foo";
  for ($i = 0; $i < 10000; $i++) {
      crc32($a);
      $a .= "o".$i;
  }
}
@nikic
Copy link
Member

nikic commented Jul 11, 2019

Merged as 2a535a9, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants