[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
I wrote a tar implementation /g/ that is slower than GNU Tar
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 15
Thread images: 2
File: Screenshot_2016-05-01_19-53-57.png (11 KB, 646x185) Image search: [Google]
Screenshot_2016-05-01_19-53-57.png
11 KB, 646x185
I wrote a tar implementation /g/ that is slower than GNU Tar by 400ms. I...Is.....is that bad /g/? :S
>>
>>54325383
isn't tar just this?
cat filea fileb filec > derp.tar
>>
>>54325562
No. tar is a fucking mess. There is a total of 5 different standards, and at least 3 types of headers.

A tar file is consisted of 512 byte blocks of files+headers+fill of zeros.

Ther zeroes are needed so that total number of bytes % 512 == 0

+ all shit for some reason is in octal in the headers, so a shitton of conversion is needed, thats why mine is so slow
>>
>>54325562
Lolnope. You're talking about concatenation. Why would we need tar if cat can do it?
>>
>>54325694
>>54325632
but... it's basically file concatenation with a header, right? sure, it has the compression stuff built in but you can just pipe to gzip.
>>
>>54325383
On how big a file?
What percent slower?
Looks to be about half as fast, which is pretty damn good.
>>
>>54325975
I use tar when I need to backup a folder in one file and then restore it as is. Cat can't recursively backup a full tree of folders and files, can it?
>>
>>54326012
Chromium, which is around...200MB probably?
>>
>>54326075
My point isn't that. tar is bottle-necked by file read and write speed. Any "enhancements" you can make to it won't matter at all.

Also, I'm sure I can think of a one line tar-like implementation in bash.

cat $(find -type f .) > derp.mydumbtar
>>
>>54326075
Guys wtf you cant cat files together. How will you unCat them? How do you know which file is where? :'D
>>
>>54326214
Pretty cool.
Does it handle more files than ram allows, and only load what it's working on?
>>
>>54326217
You cant do that because you cant keep file owners, time info, file permissions etc.
>>
File: Screenshot_2016-05-01_20-51-41.png (121 KB, 1680x1050) Image search: [Google]
Screenshot_2016-05-01_20-51-41.png
121 KB, 1680x1050
>>54326249
Yes thats what it does. Of allocated ~50MB of RAM, it uses around 10MB while extracting a 200MB file.
>>
>>54326236
> Guys wtf you cant cat files together. How will you unCat them?
Uhhh, you're right, it's hard to split them later, but not impossible. However, sometimes it's useful: http://nginx.org/en/docs/http/configuring_https_servers.html#chains
>>
Uhhh Java ? I see where the delay is coming from
Thread replies: 15
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.