Ticket #886 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[Import] 0.9 -> 0.10 : Doctrine_Import_Schema :: parseSchema is 100 times slower

Reported by: David.Stendardi Owned by: lsmith
Priority: major Milestone: 0.10.4
Component: Import/Export Version: 0.10.0
Severity: Keywords:
Cc: Has Test:
Status: Has Patch:

Description

after some investigations i found that method Doctrine_Import_Schema has a gap in performance between revision 3884 & 4024 due to a repeated call to Doctrine_Lib :: getValidators()

This repeated calls to this method inside 2 foreach statements is a waste of resource. Because Doctrine_Lib :: getValidators appear only In Doctrine_Import_Schema, i propose in the attached patch to move it inside Doctrine_Import_Schema and to remove the static property, in order to be able to cache the returned results inside a class parameter.

r 3884 performances of parseSchema on ten models

took 0.12243008613586
took 0.0047562122344971
took 0.0058200359344482
took 0.0088448524475098
took 0.0048718452453613
took 0.0041599273681641
took 0.0037109851837158
took 0.0054349899291992
took 0.0025849342346191
took 0.0070021152496338
took 0.002100944519043

r 4024 performances of parseSchema on ten models

took 5.7058351039886
took 2.4626920223236
took 1.7974109649658
took 3.806694984436
took 2.4987230300903
took 2.0322449207306
took 1.5675988197327
took 2.6904540061951
took 0.89821290969849
took 2.0223588943481

Attachments

Doctrine_Import_Schema_parseSchema.patch Download (2.3 KB) - added by David.Stendardi 2 years ago.
parseSchema speed up patch

Change History

Changed 2 years ago by David.Stendardi

parseSchema speed up patch

Changed 2 years ago by David.Stendardi

  • owner changed from somebody to lsmith
  • priority changed from minor to major
  • component changed from general to Import/Export

Changed 2 years ago by jwage

  • milestone changed from 0.10.5 to 0.10.4

Thank you very much for the patch. I am moving this to the 0.10.4 milestone.

Changed 2 years ago by jwage

  • status changed from new to closed
  • resolution set to fixed

(In [4062]) fixes #886

Note: See TracTickets for help on using tickets.