Skip to content

Performance issued due too old_fields_map functionality #920

@tmotyl

Description

@tmotyl

Magento 1.6 has introduced a _initOldFieldsMap functionality in VarienObject.
It was used to keep backward compatibility with code written pre 1.6.
As in 1.6 some db fields names has been changed.
In some models the _initOldFieldsMap returns static array (like in stock), in others like product it gets configuration from xml.

There are 3 solutions:

  1. either remove the functionality completely which would be breaking fro pre 1.6 code
  2. instead of checking configuration just return hard coded mapping in _initOldFieldsMap (this will be non breaking for pre v1.6 code, but would not allow people to add/change mapping through xml)
  3. create a static runtime cache in every odel, so configuration is read only once

I would prefer solution 1)

See: https://github.com/lizards-and-pumpkins/magento-connector/issues/143

I've spotted the issue when profiling product sales report.
And saw that on every prodct creation Magento is asking configuration for some node, creating tons of objects which are discarded right after and this triggers PHP garbage collection.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions