From ed53ecda0546d6c639fa3d227a59ace4d57b81a5 Mon Sep 17 00:00:00 2001 From: Upasana Date: Mon, 5 Mar 2018 00:58:41 +0100 Subject: Bug 1273381 - Improve bugzilla object performance by using Class::XSAccessor for object accessors --- Bugzilla/Version.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Bugzilla/Version.pm') diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm index a078cb4fc..4b509a60e 100644 --- a/Bugzilla/Version.pm +++ b/Bugzilla/Version.pm @@ -28,6 +28,7 @@ use constant DEFAULT_VERSION => 'unspecified'; use constant DB_TABLE => 'versions'; use constant NAME_FIELD => 'value'; + # This is "id" because it has to be filled in and id is probably the fastest. # We do a custom sort in new_from_list below. use constant LIST_ORDER => 'id'; @@ -147,6 +148,13 @@ sub remove_from_db { ##### Accessors #### ############################### +use Class::XSAccessor { + accessors => { + id => __PACKAGE__->ID_FIELD, + name => __PACKAGE__->NAME_FIELD, + }, +}; + sub product_id { return $_[0]->{'product_id'}; } sub is_active { return $_[0]->{'isactive'}; } -- cgit v1.2.3-24-g4f1b