Changeset 147037 in webkit


Ignore:
Timestamp:
Mar 27, 2013 5:39:23 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

cache parsed interfaces in CodeGenerator.pm
https://bugs.webkit.org/show_bug.cgi?id=113446

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-03-27
Reviewed by Kentaro Hara.

When generating binding for an interface, informations about parent
interfaces are sometimes needed several times. This patch caches
those the parsed interface. When generating all WebCore bindings, this
results in a speedup of about 40% for JavaScriptCore and about 80% for
V8.

No new tests: no change in behaviour.

  • bindings/scripts/CodeGenerator.pm:

(ParseInterface):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147034 r147037  
     12013-03-27  Arnaud Renevier  <a.renevier@sisa.samsung.com>
     2
     3        cache parsed interfaces in CodeGenerator.pm
     4        https://bugs.webkit.org/show_bug.cgi?id=113446
     5
     6        Reviewed by Kentaro Hara.
     7
     8        When generating binding for an interface, informations about parent
     9        interfaces are sometimes needed several times. This patch caches
     10        those the parsed interface. When generating all WebCore bindings, this
     11        results in a speedup of about 40% for JavaScriptCore and about 80% for
     12        V8.
     13
     14        No new tests: no change in behaviour.
     15
     16        * bindings/scripts/CodeGenerator.pm:
     17        (ParseInterface):
     18
    1192013-03-27  KyungTae Kim <ktf.kim@samsung.com> and Yongjun Zhang  <yongjun_zhang@apple.com>
    220
  • trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm

    r142739 r147037  
    9696# Cache of IDL file pathnames.
    9797my $idlFiles;
     98my $cachedInterfaces = {};
    9899
    99100# Default constructor
     
    294295    return undef if $interfaceName eq 'Object';
    295296
     297    if (exists $cachedInterfaces->{$interfaceName}) {
     298        return $cachedInterfaces->{$interfaceName};
     299    }
     300
    296301    # Step #1: Find the IDL file associated with 'interface'
    297302    my $filename = $object->IDLFileForInterface($interfaceName)
     
    305310
    306311    foreach my $interface (@{$document->interfaces}) {
    307         return $interface if $interface->name eq $interfaceName;
     312        if ($interface->name eq $interfaceName) {
     313            $cachedInterfaces->{$interfaceName} = $interface;
     314            return $interface;
     315        }
    308316    }
    309317
Note: See TracChangeset for help on using the changeset viewer.