Item11686: Performance problem when selectbox contains many options

pencil
Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: EditRowPlugin
Branches:
Reported By: VasekOpekar
Waiting For:
Last Change By: CrawfordCurrie
When formating option contains many selection options rendering of the table takes longer.

EDITTABLE{format="| select,1,dropdown1,dropdown2,dropdown3 | "}
  • if there is only "drowdown1" then page rendering takes <1sec
  • if there is 20 select options then it takes 5sec
  • performance degradation is linear (the more options the slower it is)

Test case is here EditRowPluginPerformanceTestCase (however EditRowPlugin is not installed on foswiki.org)

-- VasekOpekar - 22 Mar 2012

quick fix in EditRowPlugin/Editor/select.pm, if one doesnt mind missing functionality... not good
sub jQueryMetadata {
    my $this = shift;
    my ( $cell, $colDef, $text ) = @_;
    my $data = $this->SUPER::jQueryMetadata(@_);

    if ($colDef->{values} && scalar(@{$colDef->{values}})) {
<------># Format suitable for passing to an "erpselect" type
<------>my %d = (
<------>    order => [ @{$colDef->{values}} ],
<------>    selected => $cell->{text},
<------>    keys => {}
<------>);
<------>map {
<------>    $d{keys}->{$_} = $_;
#<-----><------>Foswiki::Func::renderText(Foswiki::Func::expandCommonVariables($_));
<------>} @{$colDef->{values}};
<------>$data->{data} = \%d;
    }
    $this->_addSaveButton($data);
    return $data;
}
-- VasekOpekar - 23 Mar 2012

probably some per column caching of the expanded and redered text would be better

-- VasekOpekar - 23 Mar 2012

The latest version of the plugin only creates elements when absolutely needed, so this problem should no longer be there. Certainly I can't reproduce it. Plugin release planned imminently.

-- CrawfordCurrie - 19 Aug 2012

 

ItemTemplate edit

Summary Performance problem when selectbox contains many options
ReportedBy VasekOpekar
Codebase
SVN Range
AppliesTo Extension
Component EditRowPlugin
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r5 - 19 Aug 2012, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy