MoodMap data discussion

How should the data be transferred between server-client:

Current solution: Too much data and too much for the device to handle

The current solution is too expensive (about 70 kb of data).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MoodMap>
<MoodMapReading> <MoodMapValue>234</MoodMapValue> <MoodMapLongitude>14.487617755003868</MoodMapLongitude> <MoodMapLatitude>35.9232054039299</MoodMapLatitude> </MoodMapReading>
<MoodMapReading> <MoodMapValue>134</MoodMapValue> <MoodMapLongitude>14.487617755003868</MoodMapLongitude> <MoodMapLatitude>35.92350484235794</MoodMapLatitude> </MoodMapReading>
<MoodMapReading> <MoodMapValue>87</MoodMapValue> <MoodMapLongitude>14.487617755003868</MoodMapLongitude> <MoodMapLatitude>35.92380428078598</MoodMapLatitude> </MoodMapReading>
</MoodMap

The device still has to do the draw operations itself - very expensive. Furthermore the deserializing is quite expensive.

Solution 1: Minimize the amount of xml send

Server xml is minimized (about 27kb of data).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<points>
	<p value="234" long="14.487617755003868" lat="35.9232054039299" />
	<p value="234" long="14.487617755003868" lat="35.9232054039299" />
	<p value="234" long="14.487617755003868" lat="35.9232054039299" />
</points>

The device still has to do the draw operations itself. Deserializing is also an expensive operation.

there is now a service setup for this format on the server, change details where appropriate.

http://localhost:8182/drunkendroid/minimizedMoodmap/130773960/131027900/35.929183/14.461684/35.874606/14.521251

Solution 2: Return int array

Server constructs an int array and returns it (about 56kb of data).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<pixels>[256,256,256]</pixels>

The int array contains the number of pixels, that the device is using (resolution) - in our case 137.600 ints.

The advantage of this solution is that the device does not has to handle the drawing of points - which is an expensive operation. Furthermore deserializing should be faster.

It is a disadvantage that the pixel array is dependent on the device's resolution. Bigger device's might increase the amount of data send.


Test setup for MoodMap

3 different methods as described on the wiki

0. as it is now
1. minimized xml, but with the same functionality as now
2. moodmap array is send back instead of point values.

purpose : to figure out what method is best in a given situation,

and what part of the process that ought too be optimized.

Each method is tested through the network from a client, either the simulator or a physical device

Each part of the process is timed eg.

  1. the full run time from the client clall till the process is complete.
  2. the server processing time, eg. the time that is used on processing the request on the server.

each of these are divided into smaller pieces, which are timed aswell.

for the server this could be.

  1. unmarshalling of the request xml
  2. database usage.
  3. building the grid.
  4. marshalling the grid into xml

for the client this could be

  1. start up of the map until the webservice is invoked.
  2. unmarshalling of xml from the server
  3. creation of overlay.
  4. the drawing of the moodmap.

Each of the tests are run with different parameters. e.g. for an area with 0,100,500,1000,worstcase readings.

(by having a test with 0 readings we can look at how much the network is a factor in the total time, by using the 0 reading test as a baseline.)

and with different gridsizes in the first 2 methods. e.g 10x10 20x20 40x40 60x60

Each of the tests are run a set number of times and the average is used for comparison.

Testsetup must be described in detail with both hardware and software configrations, these must of cause be the same for all the tests.