stas29a / doctrine

Doctrine 2 分支,性能改进

v2.5.5 2016-09-10 18:51 UTC

README

此分支包含一些性能优化。目前实现:

  • 处理大量实体时进行批量插入
  • 当需要时禁用内部事件

您需要的主要对象是 PerformanceConfiguration。以下是一个示例

//Getting performance configuration
$performanceConfiguration = $em->getPerformanceConfiguration();

//Disable internal events
$performanceConfiguration->setIsEventsSystemEnabled(false);

//Enable batch inserts
$performanceConfiguration->enableBatchInsert();

//Set how many entities will be inserted per one insert
$performanceConfiguration->setMaxPerInsert(500);

更多资源