Closed voku closed 5 years ago
Wow, the performance increase is due to the type hinting or something else? Let me know if it's complete for merging...
Noop the performance improvements comes more from reducing function & regex calls and by using strpos (https://stackoverflow.com/a/29728934/1155858) ...
e.g.:
from:
$str = \strrev(
\preg_replace(
self::$DELIMITER . $this->symbEnd . self::$DELIMITER,
"",
\strrev($str),
1
)
)
to:
$str = \preg_replace(
self::$DELIMITER . $this->symbEnd . '$' . self::$DELIMITER,
'',
$str
);
PS: for php 7.0 I think the type hints has a small negative performance effect, but a very small and it's optimized in php >= 7.1
PS: if you merge this changes, can you also add a new git tag, otherwise my IDE complains about the dev-master in my "composer.json" file, thanks :)
PS2: can you also take a look at https://travis-ci.com/php-edifact/edifact/ and register this package, so that it will be automatically tested with PHP 7.x, thanks again :)
For the Travis, I wrote a ticket because I messed up the set up... I will push a tag asap
@voku travis is failing, can you help me to understand why? https://travis-ci.com/php-edifact/edifact/jobs/163970530
[+]: "Parser" -> ~ 50% better parse performance [+]: use php7 parameter type hints
*: add ".editorconfig" -> same base config in vim, PhpStorm, ... *: add ".gitattributes" -> exclude some files, if you install the package via composer