Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create New Field API for more efficient fields #2661

Open
geru opened this issue Apr 30, 2017 · 1 comment
Open

Create New Field API for more efficient fields #2661

geru opened this issue Apr 30, 2017 · 1 comment

Comments

@geru
Copy link

geru commented Apr 30, 2017

The Field API generates a table storing data for each field. The structure of each record in the table includes two 128 character indexed fields -- one for the entity and one for the bundle to which the field is attached.

In the instance of making a boolean field, 300 bytes of data (256 of which are indexed) are used to store each boolean field containing a single bit of information.

This overhead is duplicated in the revisions table for the field. This results in wasted space and extra computer processing to find or save all that indexed information.

This storage overhead makes it problematic to use the Field API in applications that will store and access large quantities of data.

A New Field API could be much more efficient by saving simple two-byte integers that map to entity type and bundle information and using a mapping function to convert entity and bundle names to their appropriate integers. The New Field API could coexist with the old-school Field API, but provide leaner performance for new development.

Additionally, the names of entities and bundles would no longer be limited to 128 characters. They could be of arbitrary length.

@herbdool
Copy link

herbdool commented May 6, 2017

Creating more efficient fields is a noble venture but it'll probably have to wait until 2.0 for breaking any current APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants