Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.
This repository was archived by the owner on Jan 27, 2021. It is now read-only.

$this->read(1) triggers identity map of Doctrine (and others?) #7

@beberlei

Description

@beberlei

The read scenario always gets entity by id 1, which leads to triggering identity map, and these fast results compared to phalcon:

root@82c267f32816:/app# php run doctrine read 1000
Start Doctrine benchmarking...

Method:                           read
Call times:                       1000
Elapsed time:                     0.23 ms.
Memory usage:                     1.31 KiB.
Memory peak:                  2,318.59 KiB.

Total elapsed time:             245.17 ms.
Total memory usage:       2,028,436.57 KiB.
Total memory peak:            4,096.00 KiB.

root@82c267f32816:/app# php run phalcon read 1000
Start Phalcon benchmarking...

Method:                           read
Call times:                       1000
Elapsed time:                     0.76 ms.
Memory usage:                     0.07 KiB.
Memory peak:                    856.21 KiB.

Total elapsed time:             772.19 ms.
Total memory usage:         754,452.58 KiB.
Total memory peak:            2,048.00 KiB.

I would assume other ORMs also have identity maps, not mamking the query another time, which makes the read benchmarks not comparable.

It can't be changed to $i+1 though, because only id 1 has the fixture data with the comments available.

IN addition compared to my numbers, your seems way too extreme. Why kind of base system do you have for docker? I honestly wouldnt trust any numbers coming out of a docker dev environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions