I would like to store data from an object to a file and retrieve it later. I do not care of the format of the file, nor if it is human readable.
To get an overview of different approaches i wanted to ask for your suggestions of existing scripts that have this ability.
I would like to compare the code and approaches to select the right for my use case.
Please give a hint towards scripts that write/read their object content to/from a file.
Many thanks in advance.
Features I am looking for are:
- time to write
- time to read
- ability to partially update the file (nice to have)
- file size
PS: has someone already done such a comparison?
Store/retrieve Object to/from file
Store/retrieve Object to/from file
ciao
toralf
toralf
Re: Store/retrieve Object to/from file
Thanks a lot for the reference.
That is what I was looking for. Is there a way to compress the binary data during dump and uncompressed while load?
That is what I was looking for. Is there a way to compress the binary data during dump and uncompressed while load?
ciao
toralf
toralf
Re: Store/retrieve Object to/from file
Hello.
I do not know, maybe ask HotKeyIt.
Cheers.
I do not know, maybe ask HotKeyIt.
Cheers.
Re: Store/retrieve Object to/from file
ObjDump / Load is maybe overkill if all you want to do is preserve the data in objects.
You may just be fine with Coco's JSON lib: https://autohotkey.com/boards/viewtopic.php?t=627
You may just be fine with Coco's JSON lib: https://autohotkey.com/boards/viewtopic.php?t=627
Re: Store/retrieve Object to/from file
EvilC, thank you for the reference.
I’m curious, why do you think ObjDump/Load is overkill?
As a user it seems that using both is nearly identical. It is only to include them and have one command to write it and one to read the data. Even the commands are nearly identical in terms of parameters.
I’m curious, why do you think ObjDump/Load is overkill?
As a user it seems that using both is nearly identical. It is only to include them and have one command to write it and one to read the data. Even the commands are nearly identical in terms of parameters.
ciao
toralf
toralf
Re: Store/retrieve Object to/from file
I have tried 3 different ways to store the object,
1) with ObjDump
2) with JSON
3) with JSON and VarZ
The filesizes are (for a currently tiny object):
1) 6113 Bytes 100%
2) 2633 bytes 43%
3) 1905 Bytes 31%
Compressing the file with 7zip as .7z or .zip, lead to these filesizes
1) 1450/1730 bytes 24%/28%
2) 2011/2038 bytes 33%/33%
3) 1265/1354 bytes 21%/22%
I have not measured the speed or cpu usage of it yet, since the object isn't large yet.
But I'll go with 3), since it gives already a 69% reduction in filesize without extra file compression (which would at max just add another 10% reduction compared to ObjDump [or 34% relatively to the original filesize of 3)]).
Thank y'all for your support
1) with ObjDump
2) with JSON
3) with JSON and VarZ
The filesizes are (for a currently tiny object):
1) 6113 Bytes 100%
2) 2633 bytes 43%
3) 1905 Bytes 31%
Compressing the file with 7zip as .7z or .zip, lead to these filesizes
1) 1450/1730 bytes 24%/28%
2) 2011/2038 bytes 33%/33%
3) 1265/1354 bytes 21%/22%
I have not measured the speed or cpu usage of it yet, since the object isn't large yet.
But I'll go with 3), since it gives already a 69% reduction in filesize without extra file compression (which would at max just add another 10% reduction compared to ObjDump [or 34% relatively to the original filesize of 3)]).
Thank y'all for your support
ciao
toralf
toralf
Re: Store/retrieve Object to/from file
From what I understand, ObjDump is dumping methods etc too (ie dump a class instance etc) and it sounded like all you want is a data transport format, hence my comment about ObjDump being overkill
Who is online
Users browsing this forum: Google [Bot], jaka1, marypoppins_1, RussF, Spawnova, wilkster and 151 guests