Menu

#24 SingletonAnnotationSet

closed-accepted
Core (26)
5
2010-05-25
2007-12-06
No

I just found a change I'd made on my local copy of GATE ages ago. I just tested it against the build number 2820 and it seems to work fine.

I've created a class SingletonAnnotationSet which - as its name indicates - exposes a single AS as an AnnotationSet and is immutable.

The original motivation was that I noticed that SinglePhaseTransducer (used by Jape) creates an awful lot of temporary ASets which most of the time contain a single annotation. With a normal AS this triggers the creation of a lot of internal fields (maps etc...) which are absolutely not needed in this case. All these objects have to be garbage collected later, which also takes some time.

I've modified the SinglePhaseTransducer so that it uses SingletonAnnotationSets which seems to make ANNIE a bit faster. I've used the java system parameter -Xloggc which dumps statistics about the GC and found that the patched version spends substantially less time GCing (30 secs vs 35 secs).

I agree that this is probably not the most amazing gain of performance that one could think of but that is a small step in the right direction nevertheless. The impact of this patch should also be more important on machines with little RAM.

Discussion

  • Julien Nioche

    Julien Nioche - 2007-12-06

    source code for SingletonAnnotationSet + patch for SinglePhaseTransducer

     
  • Julien Nioche

    Julien Nioche - 2007-12-06

    Logged In: YES
    user_id=1939015
    Originator: YES

    as you corrected yourselves - it exposes a single ANNOTATION as an AnnotationSet

     
  • Valentin Tablan

    Valentin Tablan - 2010-05-25
    • assigned_to: nobody --> valyt
    • status: open --> closed-accepted
     
  • Valentin Tablan

    Valentin Tablan - 2010-05-25

    Patch accepted and applied.

    It was not possible to apply the exact patch as submitted because the JAPE code has changed.

    The semantics of the patch were preserved though.

    Thanks Julien!

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.