------------------------------------------------------------ revno: 305 committer: Michal Hruby <michal....@gmail.com> branch nick: bluebird timestamp: Wed 2011-10-12 23:05:59 +0200 message: Speed up marshalling! Now 3% faster! modified: src/datamodel.vala
-- lp:~zeitgeist/zeitgeist/bluebird https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird Your team Zeitgeist Framework Team is subscribed to branch lp:~zeitgeist/zeitgeist/bluebird. To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== modified file 'src/datamodel.vala' --- src/datamodel.vala 2011-09-25 12:13:01 +0000 +++ src/datamodel.vala 2011-10-12 21:05:59 +0000 @@ -362,9 +362,9 @@ vb.open (new VariantType ("as")); vb.add ("s", id.to_string ()); vb.add ("s", timestamp.to_string ()); - vb.add ("s", interpretation ?? ""); - vb.add ("s", manifestation ?? ""); - vb.add ("s", actor ?? ""); + vb.add ("s", interpretation != null ? interpretation : ""); + vb.add ("s", manifestation != null ? manifestation : ""); + vb.add ("s", actor != null ? actor : ""); vb.add ("s", origin ?? ""); vb.close (); @@ -546,6 +546,19 @@ public Variant to_variant () { + /* The FAST version */ + char* ptr_arr[8]; + ptr_arr[0] = uri != null ? uri : ""; + ptr_arr[1] = interpretation != null ? interpretation : ""; + ptr_arr[2] = manifestation != null ? manifestation : ""; + ptr_arr[3] = origin != null ? origin : ""; + ptr_arr[4] = mimetype != null ? mimetype : ""; + ptr_arr[5] = text != null ? text : ""; + ptr_arr[6] = storage != null ? storage : ""; + ptr_arr[7] = current_uri != null ? current_uri : ""; + return new Variant.strv ((string[]) ptr_arr); + /* The NICE version */ + /* var vb = new VariantBuilder (new VariantType ("as")); vb.add ("s", uri ?? ""); vb.add ("s", interpretation ?? ""); @@ -557,6 +570,7 @@ vb.add ("s", current_uri ?? ""); return vb.end (); + */ } public bool matches_template (Subject template_subject)
_______________________________________________ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp