| Q | A
| ---------------- | -----
| Bug report? | no
| Feature request? | no
| BC Break report? | no/yes
| RFC? | no/yes
| Sylius version | 1.5.3

When trying to edit a zone with 28 Countries (EU ;-))
Got a blank page and a PHP Fatal error allowed memory size of X exhausted in the log.
I set memory_limit to -1 (no limit)

Editing _Sylius\Component\Addressing\Model\Country_ fixed the issue. Do I submit a patch ? on master or 1.5 ?
// Sylius\Component\Addressing\Model\Country
....
// use Symfony\Component\Intl\Intl; removed
use Symfony\Component\Intl\Countries;
...
// return Intl::getRegionBundle()->getCountryName($this->code, $locale); removed
return Countries::getName($this->code, $locale);
Hello !
I spent some time on this exact problem yesterday afternoon.
With a much much bigger zone members list (let's say something called "Rest of the world"), replacing the old Intl::getXXXBundle() API reduces drastically the time used, but then it's still a bit too much time consuming (went from 30s timeout to a 15s loading time on a 150+ Country members zone).
The problem is, when your members are Country type for example :
CountryCodeChoiceType has a list of Country elements as choices Country->getName() (using the choice_value type option), which then subsequently calls the Symfony Intl componentschoices are then sorted using usort which, for the comparison, calls... Country->getName() Somehow all those forms shouldn't access to the Intl component data a trillion time, it should be passed by parent form (in those cases, the country list is not gonna change from one member to another).
I fear this kind of thing could happen with every other Intl components (locales, currencies, etc...) but I don't think Sylius has another page which can potentially gather so many items of those types.
Any thoughts on this on the Sylius side ? :D
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.
@pamil @lchrusciel This issue was fixed in master/1.8 with #10565.
hey @stloyd, thanks for picking it up!
Most helpful comment
Hello !
I spent some time on this exact problem yesterday afternoon.
With a much much bigger zone members list (let's say something called "Rest of the world"), replacing the old
Intl::getXXXBundle()API reduces drastically the time used, but then it's still a bit too much time consuming (went from 30s timeout to a 15s loading time on a 150+ Country members zone).The problem is, when your members are
Countrytype for example :CountryCodeChoiceTypehas a list ofCountryelements as choicesCountry->getName()(using thechoice_valuetype option), which then subsequently calls the Symfony Intl componentschoicesare then sorted usingusortwhich, for the comparison, calls...Country->getName()Somehow all those forms shouldn't access to the Intl component data a trillion time, it should be passed by parent form (in those cases, the country list is not gonna change from one member to another).
I fear this kind of thing could happen with every other Intl components (locales, currencies, etc...) but I don't think Sylius has another page which can potentially gather so many items of those types.
Any thoughts on this on the Sylius side ? :D