Comment 102 for bug 1439288

Revision history for this message
In , Aliakc (aliakc) wrote :

Explaination (old patch):

main() {
  while (1) {
    call_fkt_a(); // thunar_transfer_job_veryify_destination
    call_fkt_b(); // thunar_transfer_job_get_status
  }
}

call_fkt_a() {
  call_prefs_object_reference(); // calls xfconf which calls dbus

  if (foo file list exist) {
    return;
  }

  if (nested block) {
    fkt_gimme_misc_binary_size_info();
  }
}

call_fkt_b() {
  ; // left untouched
}

My patch only reduced noise on the bus:

main() {
  while (1) {
    call_fkt_a(); // thunar_transfer_job_veryify_destination
    call_fkt_b(); // thunar_transfer_job_get_status
  }
}

call_fkt_a() {
  if (foo file list exist) {
    return;
  }

  if (nested block) {
    call_prefs_object_reference(); // calls xfconf which calls dbus

    fkt_gimme_misc_binary_size_info();
  }
}

call_fkt_b() {
  ; // left untouched
}

The new patch does:

main() {
  while (1) {
    call_fkt_a(); // thunar_transfer_job_veryify_destination
    call_fkt_b(); // thunar_transfer_job_get_status
  }
}

call_fkt_a() {
  if (foo file list exist) {
    return;
  }

  if (nested block) {
    get_from_cache();
    fkt_gimme_misc_binary_size_info();
  }
}

call_fkt_b() {
  call_prefs_object_reference(); // calls xfconf which calls dbus
  store_in_cache();
}

But looking in the main section and in the while statement, both functions are called sequentially (and probably (this is just my guess)) with the same fequency. So basicly from guessing by the functions name, the function "thunar_transfer_job_execute" seem to be from same high frequency than the "check_destination" one, where this preference object referencing was done before (if not higher) -> nails dbus.