From: Piotr T. <pio...@gm...> - 2010-09-12 07:59:32
|
Hello Cobertura masters, Long time ago (March) I promised to provide a really faster version of Cobertura, but I started to be really busy then. Finally I found some time and prepared it. It is stored here: https://cobertura.svn.sourceforge.net/svnroot/cobertura/branches/ptab_v2_0 (should be probably 1.10) and the net.sourceforge.cobertura.instrument package is totally rewritten. The current status is: Additional benefits: * Speed, speed, speed * It is extremly close to supress requirement that *.sar file created during instrumentation is needed during runtime. In fact the file is now created only for backward compability. * SwitchFunctionalTest works now. Some simillar fixes to coverage in other areas. * I think that the new code is cleaner. Drawbacks: * To count the hits I'm using in this implementation just: int[] hits; and to register hit I use: hits[...]++; It is extremly fast, but not exactly thread safe. There will be no 'exception' thrown or other problems, but we can miss some hits (tests shows that it is <5% of hits). But it is guaranteed that if there is at least one hit for a single touch-point, it will be registered. So it does not affect coverage, and seams to be acceptable for 99.9% usage scenarios. If required an exact-thread-safe mode can be implemented (see AtomicArrayCodeProvider) (but usege of AtomicIntegerArray causes significant (5-10 times) performance decrease - but still is faster then cobertura 1.9.4+). TODO: * ignore and ignore trival functionality has not been merged yet * exact-thread-safe mode swotch * The code need more tests I would appreciate if you (John ?) could have a look at the code and scribe opinion about it. Regards, Piotr Tabor |