We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for your awesome project.
Can we improve performance by replacing tokenize to token_get_all ?
tokenize
token_get_all
tinpont@local:~/expression-test$ php -f compare.php token_get_all: 0.077315092086792 StringCalc: 2.0649530887604
Source code:
<?php require 'vendor/autoload.php'; $limit = 100000; $expression = 'INT(W*0.013)*0.014'; $startTime = microtime(true); for ($i = 0; $i < $limit; $i ++) { $tokens = token_get_all("<?php $expression;"); } echo 'token_get_all: ' . (microtime(true) - $startTime) . PHP_EOL; $stringCalc = new ChrisKonnertz\StringCalc\StringCalc(); $startTime = microtime(true); for ($i = 0; $i < $limit; $i ++) { $tokens = $stringCalc->tokenize($expression); } echo 'StringCalc: ' . (microtime(true) - $startTime) . PHP_EOL;
The text was updated successfully, but these errors were encountered:
Hello, did you experience actual performance issues when using this library?
Sorry, something went wrong.
In fact it did not. But I think that it still have a chance to improve performance.
chriskonnertz
No branches or pull requests
Thanks for your awesome project.
Can we improve performance by replacing
tokenize
totoken_get_all
?tinpont@local:~/expression-test$ php -f compare.php token_get_all: 0.077315092086792 StringCalc: 2.0649530887604
Source code:
The text was updated successfully, but these errors were encountered: