Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - pilot-db write benchmark

pilot-db write benchmark

A PocketC native palm library offering native forms and assorted utilities

Postby tthkbw on Wed Oct 30, 2002 4:44 am

Joe,

I compared the performance of dbwrite and the pilot-db functions.

Basically, the pilot-db functions are a bit more than 2 times faster. However, having to translate all my integer data to strings kills all the performance and results in more than 2 times slower performance.

Here is the code used to write the pocketc database:

dbrec(0);
dbremrec(0);
dbrec(-1);
dbwritex(&config_data[0],config_data_db_format_string);
dbwritex(&game_data[0][0],game_data_db_format_string);
for (i=0;i<MAX_PLAYERS;i++) {
dbwritex(&home_team_ptr[i][0],team_db_format_string);
}
for (i=0;i<MAX_PLAYERS;i++) {
dbwritex(&visitor_team_ptr[i][0],team_db_format_string);
}
dbwritex(&roster_visitor,roster_db_format_string);
dbwritex(&roster_home,roster_db_format_string);
dbwritex(&clock_ticker,"i4");
dbclose();

and here is the code for ptoolbox and pilot-db:

i = MAX_PLAYERS;
while (i--) {
player = home_team_ptr[i];
hold = Join(19,player,",");
Split(&hold,19,&data,",");
DBsetrec(-1,data);
}
//for (i=0;i<MAX_PLAYERS;i++ ) {
i = MAX_PLAYERS;
while (i--) {
player = visitor_team_ptr[i];
hold = Join(19,player,",");
Split(&hold,19,&data,",");
DBsetrec(-1,data);
}

In addition, the ptoolbox stuff has the creation of the database as well. The data structure being written is one string and 18 integers per player. The Split and Join functions speed things up compared to just assigning to the string data[19]. hold is simply a string.

Note that the pocketc database in this case also gets slightly more data, I didn't bother with writing the config and game data arrays in the second case.

I timed this on the emulator, which doesn't give a "real" time, but I think is proportional and is reproducible. The pocketc version takes 1960 milliseconds, the ptoolbox version takes 4590 milliseconds.

However, if I didn't have to convert the data, (I just wrote it the first time, hoping :), then the Ptoolbox version took only 860 milliseconds. Of course, all the data was wrong!

I guess I don't understand why, when pilot-db supports all these cool data types, they must be written as strings rather than their native type.

Comments??



tthkbw
tthkbw
 
Posts: 75
Joined: Wed Nov 07, 2001 4:04 pm
Location: USA

Postby jstadolnik on Wed Oct 30, 2002 12:51 pm

First thanks for doing the benchmark.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I guess I don't understand why, when pilot-db supports all these cool data types, they must be written as strings rather than their native type.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

The reason for this is so that users can seamlessly switch between HanDBase and Pilot-DB formats (the HanDBase format requires all inputs to be strings).

The good news is that I can relax the string restriction for the Pilot-DB format, allowing it to accept integers and floats where appropriate. I'll plan on implementing this, if not for the next release, some sub-release thereafter. When the dust is settled I suspect the speed will be even faster than what you benchmarked.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby shurcooL on Sun Aug 24, 2003 2:36 pm

yeah, i would really like this feature too. :P

thanks,
shurcooL
thanks,
shurcooL
shurcooL
 
Posts: 38
Joined: Sat May 17, 2003 6:25 pm
Location: Canada


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest

cron