[Webkit-unassigned] [Bug 8177] Javascript search incredibly slow

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Mon Jun 19 13:37:24 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=8177


darin at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #8882|review?                     |review-
               Flag|                            |




------- Comment #8 from darin at apple.com  2006-06-19 13:37 PDT -------
(From update of attachment 8882)
m_CollectionInfo should be m_collectionInfo (both of them) and
m_NameCollectionInfo should be m_nameCollectionInfo.

NUM_CACHEABLE_TYPES no longer seems to be a good name since now it's just the
dividing line between ones that have no name and ones that have a name. Also no
need for it to be all capitals -- macros are supposed to have all capital
names, but that's not appropriate for enums or constants (I know, preexisting
issue, not something you did).

+    HashMap<String, HTMLCollection::CollectionInfo>::iterator iter =
map.find(name);
+    if (iter != map.end())
+        return &iter->second;
+    
+    return &map.add(name, HTMLCollection::CollectionInfo()).first->second;

I think it would be cool to just say:

    if (iter == map.end())
        iter = map.add(name, ...);

to collapse the two cases into one.

Is there goint to be trouble having lots of cached collections under different
names, with no limit on the number? Could this lead to memory bloat?

Otherwise looks great.

review- just for the nitpicks above.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list