I'm in favor of something much less designed. The extra object (i.e. the
internal JSO) seems unnecessarily costly, considering that we're not trying
to comply with an existing API such as the JRE Map interface.
Why not avoid an abstract base class that necessitates polymorphism, adapter
objects, etc., and instead use a JSO directly?
final class JsMapStringObject<V> extends JavaScriptObject {
public native V get(String k) /*-{ return this[k]; }-*/;
public native void put(String k, V v) /*-{ this[k] = v; }-*/;
}
This is admittedly less than full-featured and might need a little more (of
course), but if the point is to do something special-purpose that's fast,
then shouldn't we take it all the way?
In the same vein, we could also create:
JsMapStringInt
JsMapIntObject
JsMapIntInt
...and maybe others...
On Thu, Sep 4, 2008 at 11:45 PM, Emily Crutcher <[EMAIL PROTECTED]> wrote:
> Ah, I see what happened, when tortoise makes a branch of the working
> directory it, logically enough, does not include files which have not been
> officially added to trunk. The files should be there now.
>
>
> On Thu, Sep 4, 2008 at 7:36 PM, Folke <[EMAIL PROTECTED]> wrote:
>
>>
>> Hi Emily
>>
>> Did you commit the files? I'm really interested in your
>> implementation. This directory is empty:
>>
>> http://code.google.com/p/google-web-toolkit-incubator/source/browse/branches/ecc/collectionsReview/src/com/google/gwt/gen2/collection
>>
>> Folke
>>
>>
>> On Sep 5, 12:28 am, "Emily Crutcher" <[EMAIL PROTECTED]> wrote:
>> > John, master of JRE collections, Could you review this?
>> >
>> > For big applications, map's performance can end up being a bottleneck.
>> This
>> > code review introduces the AbstractJsMap, which is a slightly modified
>> API
>> > so that we can create faster map implementations.
>> >
>> > The code contains new directories, so here is a read-only branch with
>> the
>> > code in it:
>> http://code.google.com/p/google-web-toolkit-incubator/source/browse/#...
>> >
>> > Attached is the benchmark for putting then getting 1000 through 10,000
>> > strings, where HashMap is compared to the new JsStringMap. For the
>> compiled
>> > put/get benchmark, it is between 300%-500% faster.
>> >
>> > Thanks,
>> >
>> > Emily
>> >
>> > --
>> > "There are only 10 types of people in the world: Those who understand
>> > binary, and those who don't"
>> >
>> > Mozilla4_003.png
>> > 22KViewDownload
>> >
>> > report-JsStringMap.xml
>> > 11KViewDownload
>>
>>
>
>
> --
> "There are only 10 types of people in the world: Those who understand
> binary, and those who don't"
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---