[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GT] Storable
Quoting Oliver Bossert:
> Hi everybody,
Hi Oliver !
> I did a lot of various backtesting in the last weeks. I had two
> problems: The files in which I saves the portfolio consume a lot of
> space and they are not human-readable; this makes debugging and
> processing by external programs harder and I don#t know if I can read
> the files after a change in the Storable-module.
>
> I therefore extended the Storable.pm by adding an interface to
> XML::Dumper. By compressing the xml-files the size of file is 30% of
> the original one and I can read and modify them.
I fully subscribe to your problematic that's why I started some rework
at that time in the experimental branch of the CVS :
http://www.geniustrader.org/cgi-bin/viewcvs.cgi/GT/?only_with_tag=experimental
I had only one problem : I wanted to use an XML module which would work
both on Windows and on Linux. That's why I wrote it7 with the XML::Mini
module and not the standard LibXML one. However XML::Mini is too limited
and it fails to parse big files like ones that we can generate with
GeniusTrader.
My solution was more or less a rewrite of XML::Dumper with XML::Mini but
it fails to work satisfyingly (it creates XML fine but it can't read
them if they are too big).
Therefore my suggestion is to port my work to LibXML now that LibXML is
working on the Windows side as well and to drop the "Serializer"
interface completely and to use the new unique "Serializable" module
which can be used by any module which may need to be serialized :
http://www.geniustrader.org/cgi-bin/viewcvs.cgi/GT/Attic/Serializable.pm?rev=1.1.2.3&only_with_tag=experimental&content-type=text/vnd.viewcvs-markup
Once a module exposes the "Serializable" interface, any associated
object can be called with :
- $obj->store("filename") or $obj->(\*FILE)
- $obj->as_string()
Or you can create instances of the object with :
GT::MyModule->create_from_string($string)
GT::MyModule->create_from_file("filename" or \*FILE)
What do you think of this plan ?
Feel free to ask more precise questions if I haven't been clear enough
in my explanation. I'd like this to happen however.
> The patch is just for your personal information; I think we should
> not include it in GT because it is one more module that the user has
> to provide and the code is'nt nice at all...
Agreed, that's why I rewrote XML::Dumper as well, the dependency on
XML-Parser is just painful ...
http://www.geniustrader.org/lists/devel/msg00466.html
BTW, I'd like to extend www.geniustrader.org so that people can find the
explanation of how to use GT on Windows. Would you volunteer to
integrate the content of the page on your site within
www.geniustrader.org if I put the website under CVS control ?
Cheers,
--
Raphaël Hertzog -+- http://www.ouaza.com
Formation Linux et logiciel libre : http://www.logidee.com
Earn money with free software: http://www.geniustrader.org