Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PHP ORM Performance Analysis: Benchmarking and comparing Doctrine, Laravel, Cycle, and CompositePHP ORMs in CRUD operations on MySQL. Essential insights on speed and memory efficiency for PHP developers.

NotificationsYou must be signed in to change notification settings

compositephp/php-datamapper-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This repository contains benchmarks for some of the most popular PHP DataMapper's, used as a reference for performanceoptimizations in my personal projectcompositephp/db.

The projects benchmarked include:

Methodology

  • The benchmark executes 10 000 CRUD (Create, Read, Update, Delete) operations to assess the performance.
  • The benchmark tests focus exclusively on the 'DataMapper' component of each project, employing simple queries that donot involve relationships, foreign keys, or joins.

Operations include:

  1. Creating a new record in the database.
  2. Reading the record by primary key.
  3. Updating one field for the found record.
  4. Deleting the record.

Database

  • MySQL 8.0
  • Table used for the benchmark:
CREATETABLEIF NOT EXISTS Users(`id`INTEGERNOT NULLPRIMARY KEY AUTO_INCREMENT,`name`VARCHAR(255)NOT NULL,`age`INTEGERNOT NULL,`microtime` FLOATNOT NULL,`created_at`TIMESTAMP DEFAULTCURRENT_TIMESTAMPNOT NULL);

Results

MacBook Pro with Apple M2 Pro Chip and 12‑Core CPU:

ProjectTime (seconds)Memory KbMemory Peak Mb
Laravel Eloquent61.514950.918.063
Cycle ORM44.32288.157.007
Doctrine37.45870.246.408
CompositeDB24.71143.462.217
PHPFUI ORM20.43109.372.196

Running Locally

Requirements

  • PHP 8.1+
  • Docker
  • Composer
  • PDO_MySQL extension

Steps

  1. Clone or download this repository
  2. Runcomposer update
  3. Executedocker-compose up
  4. Run benchmarks for each DataMapper separately:
    • php src/test-laravel.php
    • php src/test-cycle.php
    • php src/test-doctrine.php
    • php src/test-composite.php
    • php src/test-PHPFUI.php

Note

This is a synthetic benchmark focused on speed and memory consumption and does not compare the feature list of the projects.Feel free to note any problems, inaccuracies, or shortcomings in using these projects and make a pull request to fix them.

About

PHP ORM Performance Analysis: Benchmarking and comparing Doctrine, Laravel, Cycle, and CompositePHP ORMs in CRUD operations on MySQL. Essential insights on speed and memory efficiency for PHP developers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp