PDA

View Full Version : Helper functions performance


radub
05-09-2002, 12:41 PM
I am concerned with some of the helper functions performance.

Profiling some code, on the emulator, I found out that:
on a pretty complicated sequence, repeated for 3 million times that's executed in 5 secs, adding a STRCMP call adds 10 secs to the total execution time! It means 2/3 of the time is spent in STRCMP! if adding STRLEN too I end up with 21 secs total time - 3/4 of the time doing STRCMP & STRLEN. For comparison, using "string.h" functions (strcmp & strlen) results in only 1 sec overtime. Please compare 1 sec with 16 secs!

I'd like to know if this happens on BREW 1.1 only or you had similar experiences on BREW 1.0

Thanks
Radu

PS: ISHELL_CreateInstance is extremelly expensive too - 13 secs for the above mentioned loop...

kamal
05-22-2002, 01:00 PM
Few BREW API functions including the helper functions traverse the heap to validate the pointers. This is done to make sure that pointers passed in the parameters are correct. This heap traversing is done only on the BREW Emulator but not on the device.

On the actual device, overhead is only associated with the vtable. So benchmark tests on the emulator does not reflect the performance on the device. Heap traversing is the reason you are getting the big difference in performance of the standard "C" library functions in comparison to BREW stdlib functions on the emulator. Reason for doing heap traversing is to make sure that some invalid memory access errors, invalid pointer errors can be caught on the emulator itself.

Please note that if you compare the performance on the device then it will be advisable to test both BREW and Java on same device to compare the numbers. Numbers will also depend on the processor speed.

radub
05-23-2002, 08:26 AM
Thanks Kamal!

But doesn't it come against the speed emulation concept? Shouldn't the heap traversal be disabled in speed emulation mode? In my tests there is no difference between enabled/disabled - it's only that Sharp emulator is much slower than the others (almost twice)...

Radu

amit21481
09-10-2004, 08:39 AM
can anyone tell me how to create a DST file...i have the DISPSPEEDTUNE Applet but it never runs ..it gave me an "unknown error" ..what shud i do?
help!!!! :(