[Xastir-Dev] Latest CPU-usage fixes

Curt Mills hacker at tc.fluke.com
Wed Aug 13 16:08:38 EDT 2003


Developer's CVS Xastir (should be available tomorrow via anon CVS)
is using one second of CPU time for every 57.9 seconds of real time,
with multiple high-speed feeds attached.  CPU usage reported by top
is usually 0.0% or 0.1% for all threads.

I can't be sure yet, but I think memory usage is down as well.  I'll
know more after I let it run for a few days.  I did find/plug a leak
last week where memory was malloc'ed and left unused, but I thought
that was a very minor leak.  Perhaps it added up over time.

Here's the current "oprofile" output (last 30 shown) with about 9000
stations received by Xastir:


Xastir CPU%   Function name
-----------   -------------------------
0.735101      popup_time_out_check
0.743852      is_my_call
0.778857      relay_digipeat
0.840116      extract_weather
0.840116      end_critical_section
0.901374      check_for_new_gps_map
0.962632      normal_title
0.962632      convert_lat_s2l
1.05014       draw_nice_string
1.0589        valid_call
1.10265       remove_trailing_asterisk
1.10265       port_dtr
1.10265       begin_critical_section
1.42645       decode_ax25_line
1.46145       packet_data_add
1.4702        channel_data
1.51396       valid_path
1.61897       alert_match
1.64523       decode_info_field
1.70648       dtr_all_set
2.04778       draw_trail
2.09154       display_file
3.63175       langcode
4.41061       draw_symbol
4.59438       data_add
4.97943       display_station
6.47589       UpdateTime
7.49978       symbol
9.36379       port_read
11.7879       search_station_name


symbol() and langcode() could be optimized by implementing hash
table lookups for them, but it's probably not worth the effort as
overall CPU usage is quite small.  When we started,
search_station_name() was using 97% of Xastir's time, and overall
CPU usage (via "top") was a lot higher.  Implementing a hash table
lookup for that function gave us lots of free CPU to play with.

It must be time to go optimize map drawing now.

-- 
Curt Mills, WE7U                    hacker_NO_SPAM_ at tc.fluke.com
Senior Methods Engineer/SysAdmin
"Lotto:    A tax on people who are bad at math!"
"Windows:  Microsoft's tax on computer illiterates!" -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Xastir-dev mailing list