It's remarkably easy to write and read the necessary binary file, provided you stick to Perl. The necessary code is in the Perl core module Storable (http://perldoc.perl.org/Storable.html). All you have to do is collect references to the data you want to save in an array and call Storable::store(\@data, $filename); To recreate the data structure, execute $ref_to_data = Storable::retrieve($filename);
Of course it's wise to add some error checking, but still very little code is necessary. mån 2011-04-11 klockan 17:49 +0200 skrev Murray Cumming: > On Mon, 2011-04-11 at 17:13 +0200, Kjell Ahlstedt wrote: > > Yes, I think a binary file with the info from the defs and xml files is > > the best way to speed up gmmproc. It's too complicated to combine a > > many-files-per-invocation version of gmmproc with concurrent jobs, run > > by make. See https://bugzilla.gnome.org/show_bug.cgi?id=646820#c1 > > I worry that an intermediate binary file format, and the code to create > and parse it, would be an obstacle to further improvement. > > On the other hand, if this makes someone happy enough to work on other > gmmproc features, such as using gobject-introspection typelibs instead > of .defs, then it would be socially worthwhile. > > > > > Kjell > > > > tis 2011-04-05 klockan 03:59 +0200 skrev Krzysztof Kosiński: > > > 2011/4/4 Krzesimir Nowak <[email protected]>: > > > > Yeah, reading defs and xml files everytime is the bottleneck, but > > > > current implementation also makes it possible run several gmmprocs > > > > concurrently (by make -j4). > > > > > > To get the best of both worlds, there could be an extra program which > > > reads the XML files and outputs a binary file which maps directly to > > > the data structures used in gmmproc. Each instance of gmmproc could > > > then use the binary files, which would avoid the parsing overhead on > > > every run. > > > > > > However, a total rewrite of gmmproc is direly needed anyway. Right now > > > in order to add a new wrapping command you need to know both M4 and > > > Perl, and be able to decipher complex M4 code with arcane quoting > > > rules. (I tried it and failed.) It seems most C++ bindings people have > > > given up on trying to add features to gmmproc and are just writing > > > code by hand. > > > > > > Regards, Krzysztof > > > _______________________________________________ > > > gtkmm-list mailing list > > > [email protected] > > > http://mail.gnome.org/mailman/listinfo/gtkmm-list > > > > > > _______________________________________________ > > gtkmm-list mailing list > > [email protected] > > http://mail.gnome.org/mailman/listinfo/gtkmm-list > _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
