Re: [AD] slow fonts

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Ran a profile on a modified ex_font.c program. It just looped for
about 10 seconds and printed three lines of text each iteration.

~~~
	while (al_event_queue_is_empty(queue))
	{	
		/* Draw red text */
		al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA,
		  al_map_rgb(255, 0, 0));
		al_draw_textf(f, 10, 10, 0, "red %d", i++);

		/* Draw green text */
		al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA,
		  al_map_rgb(0, 255, 0));
		al_draw_textf(f, 10, 50, 0, "green green green green green green
green green ");
	
		/* Draw a unicode symbol */
		al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA,
		  al_map_rgb(0, 0, 255));
		al_draw_textf(a4f, 10, 90, 0, "Mysha's 0.02€");

		al_flip_display();
	}
~~~~

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 54.59      1.13     1.13      842     0.00     0.00  _argb_8888_to_argb_8888
 29.95      1.75     0.62     1801     0.00     0.00
_al_draw_bitmap_region_memory
  2.42      1.80     0.05  1783808     0.00     0.00  get_factor
  2.42      1.85     0.05   357246     0.00     0.00  _al_put_pixel
  1.45      1.88     0.03   445952     0.00     0.00  _al_blend_inline
  0.97      1.90     0.02   370936     0.00     0.00  tls_get
  0.97      1.92     0.02   173919     0.00     0.00  al_fgetc
  0.97      1.94     0.02      838     0.00     0.00  _al_d3d_sync_bitmap
  0.48      1.95     0.01   564381     0.00     0.00  al_get_pixel_size
  0.48      1.96     0.01   269590     0.00     0.00  al_map_rgba
  0.48      1.97     0.01   205505     0.00     0.00  al_get_pixel
  0.48      1.98     0.01     1560     0.00     0.00  al_lock_bitmap_region
  0.48      1.99     0.01      511     0.00     0.00  font_find_character
  0.48      2.00     0.01       28     0.00     0.00
_al_d3d_prepare_bitmaps_for_reset
  0.48      2.01     0.01        4     0.00     0.00  file_stdio_fopen
  0.48      2.02     0.01        2     0.01     0.02  al_convert_mask_to_alpha
  0.48      2.03     0.01        2     0.01     0.04  al_load_tga_entry
  0.48      2.04     0.01        1     0.01     0.01  al_load_config_file
  0.48      2.05     0.01        1     0.01     0.03  al_load_pcx_entry
  0.24      2.06     0.01      845     0.00     0.00  _al_convert_bitmap_data
  0.24      2.06     0.01        2     0.00     0.00
_al_draw_bitmap_region_memory_fast
  0.24      2.06     0.01                             _abgr_f32_to_abgr_f32
  0.24      2.07     0.01
_al_draw_rotated_bitmap_memory


--
Matthew Leverton

Attachment: profile.zip
Description: Zip archive



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/