G
Graham McKechnie
Hi All,
I'm looking for some feedback re performance issues with C#. in .NET CF.
I've just finished converting a Palm app to PPC. I've struggled with
performances issues most of the way and have got around many problems, but I
'm now faced with a particular issue, where I expected the performance of
the app to be similar to the Palm app, if not better, but unfortunately it
is way slower. In fact it's a shocker, just awful.
I'm beginning to think that the performance issue maybe due to C# itself or
even the compact framework. I'm even thinking along the lines of just
chucking C# and rewriting in embedded C++. However before going that route,
I'd like to ask you guys for your thoughts, especially those who may have
had similar experience i.e. converting a Palm app to PPC.
I originally developed the Palm app in C and tested on a Palm Vx with 8meg
of memory. It works extremely well. Its fast and it was well received by the
doctors it was aimed at. When I say fast, I mean that all windows display
instantly, all database access (includes many tables ranging from 8000 to
13000 rows) seem to fly. At the end of the development cycle, the Tungsten
was released and the performance was a real leap again. It really blew me
away, the first time I saw it working on a T.
I figured ( and this is where I might have got it wrong ) that this app
would be just as good on PPC. My thoughts at the time were, that the Palm Vx
had a pretty puny processor, and as PPCs had much more powerful processors,
it should therefore fly on a PPC. Anyway I purchased a iPAQ 5450 and was
disappointed with the performance from day one - e.g. my contacts database
appeared slow as compared to the Palm Address app, the screen displays weren
't really snappy compared to the Palm, scrolling through a list of contacts
was much slower etc.
Sorry for the long background, but it may help for later. The main point of
contention is the process we go through when a doctor prescribes a
medication for a patient. When a doctor prescribes a drug for a particular
patient, the doctor has to consider the effect that drug may have on the
patient. The patient may have certain allergies that this drug could
trigger, the patient may already be on a existing medication, that the
prescribed drug could trigger an adverse interaction with the existing
medication, because of a particular ingredient in the prescribed medication.
The patient may already be suffering from a disease, that the prescribed
drug could make worse.
To help the doctor accurately prescribe a drug, we look at the patient's
allergies, existing diseases and existing medications and do a heap of
checks before writing the script. If during this process the checks find
something, we display a warning window, which can be for a allergy, an
ingredient interaction or a disease interaction. The doctor at this point
can ignore the warning and proceed to the next potential warning or just
cancel the medication and re think the medication.
This is the part that is causing the grief. When a patient is selected, 3
list boxes containing the patients allergies, existing medications and a
history of diseases are populated and at the same time are saved in memory
in Array Lists, so that we can use those Array Lists if the doctor decides
to prescribe a medication at a later point, quite a few windows down the
track.
If the patient is healthy, i.e. has no allergies, existing medications or
diseases and the doctor prescribes a drug, then the process is nearly
instantaneous as the new medication is written to the table. I have a
progress bar display, which indicates its processing Allergies, Interactions
and Diseases. For the healthy patient, the progress bar just flashes by.
Unfortunately for the unhealthy patient, it crawls. Under the same
conditions (same patient, same data) on the Palm its super quick - in fact
the Palm code doesn't even have a progress bar - it wasn't necessary.
Basically the C# code is the same as the original C code, except that the C#
code takes a more OPP approach being C#. In fact I thought the C# code would
have been faster, because all the interaction and disease data is built in
memory, where as the C code creates temp tables on the Palm for both the
interaction data and the disease data.
The worst case scenario is a drug that has 98 interactions for one
ingredient. All the processing is done looping through the Array Lists,.
Each Array List contains either interaction or disease objects.
It would appear that C# or CF is just not real speedy at processing Array
Lists.
I obviously would like to complete the app in C#, so I would appreciate any
suggestions/techniques, that could speed up the process. However I would
also appreciate advice from C/C++ programmers. In other words can I expect a
speed improvement if I rewrite it in C or is the operating system on these
processors that is the problem. I'm leaning towards the OS, because all my
tests on the desktop using C# and .Net indicate that this approach works
well and is fast.
In fact the desktop system, even though not written in C# performs
beautifully using the same approach.
PS I've read where the PXA250 as in my 5450 may not be the fastest thing
going around. Can anyone recommend a PPC that is really fast. Has wireless,
BT etc.
Regards
Graham
I'm looking for some feedback re performance issues with C#. in .NET CF.
I've just finished converting a Palm app to PPC. I've struggled with
performances issues most of the way and have got around many problems, but I
'm now faced with a particular issue, where I expected the performance of
the app to be similar to the Palm app, if not better, but unfortunately it
is way slower. In fact it's a shocker, just awful.
I'm beginning to think that the performance issue maybe due to C# itself or
even the compact framework. I'm even thinking along the lines of just
chucking C# and rewriting in embedded C++. However before going that route,
I'd like to ask you guys for your thoughts, especially those who may have
had similar experience i.e. converting a Palm app to PPC.
I originally developed the Palm app in C and tested on a Palm Vx with 8meg
of memory. It works extremely well. Its fast and it was well received by the
doctors it was aimed at. When I say fast, I mean that all windows display
instantly, all database access (includes many tables ranging from 8000 to
13000 rows) seem to fly. At the end of the development cycle, the Tungsten
was released and the performance was a real leap again. It really blew me
away, the first time I saw it working on a T.
I figured ( and this is where I might have got it wrong ) that this app
would be just as good on PPC. My thoughts at the time were, that the Palm Vx
had a pretty puny processor, and as PPCs had much more powerful processors,
it should therefore fly on a PPC. Anyway I purchased a iPAQ 5450 and was
disappointed with the performance from day one - e.g. my contacts database
appeared slow as compared to the Palm Address app, the screen displays weren
't really snappy compared to the Palm, scrolling through a list of contacts
was much slower etc.
Sorry for the long background, but it may help for later. The main point of
contention is the process we go through when a doctor prescribes a
medication for a patient. When a doctor prescribes a drug for a particular
patient, the doctor has to consider the effect that drug may have on the
patient. The patient may have certain allergies that this drug could
trigger, the patient may already be on a existing medication, that the
prescribed drug could trigger an adverse interaction with the existing
medication, because of a particular ingredient in the prescribed medication.
The patient may already be suffering from a disease, that the prescribed
drug could make worse.
To help the doctor accurately prescribe a drug, we look at the patient's
allergies, existing diseases and existing medications and do a heap of
checks before writing the script. If during this process the checks find
something, we display a warning window, which can be for a allergy, an
ingredient interaction or a disease interaction. The doctor at this point
can ignore the warning and proceed to the next potential warning or just
cancel the medication and re think the medication.
This is the part that is causing the grief. When a patient is selected, 3
list boxes containing the patients allergies, existing medications and a
history of diseases are populated and at the same time are saved in memory
in Array Lists, so that we can use those Array Lists if the doctor decides
to prescribe a medication at a later point, quite a few windows down the
track.
If the patient is healthy, i.e. has no allergies, existing medications or
diseases and the doctor prescribes a drug, then the process is nearly
instantaneous as the new medication is written to the table. I have a
progress bar display, which indicates its processing Allergies, Interactions
and Diseases. For the healthy patient, the progress bar just flashes by.
Unfortunately for the unhealthy patient, it crawls. Under the same
conditions (same patient, same data) on the Palm its super quick - in fact
the Palm code doesn't even have a progress bar - it wasn't necessary.
Basically the C# code is the same as the original C code, except that the C#
code takes a more OPP approach being C#. In fact I thought the C# code would
have been faster, because all the interaction and disease data is built in
memory, where as the C code creates temp tables on the Palm for both the
interaction data and the disease data.
The worst case scenario is a drug that has 98 interactions for one
ingredient. All the processing is done looping through the Array Lists,.
Each Array List contains either interaction or disease objects.
It would appear that C# or CF is just not real speedy at processing Array
Lists.
I obviously would like to complete the app in C#, so I would appreciate any
suggestions/techniques, that could speed up the process. However I would
also appreciate advice from C/C++ programmers. In other words can I expect a
speed improvement if I rewrite it in C or is the operating system on these
processors that is the problem. I'm leaning towards the OS, because all my
tests on the desktop using C# and .Net indicate that this approach works
well and is fast.
In fact the desktop system, even though not written in C# performs
beautifully using the same approach.
PS I've read where the PXA250 as in my 5450 may not be the fastest thing
going around. Can anyone recommend a PPC that is really fast. Has wireless,
BT etc.
Regards
Graham