[go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-21 Thread Sri G
Pros: + Getting stats on popular packages and code. Keeping anonymity should be like apt on debian/ubuntu by requesting permission for anonymous stats reporting. + Showing Go's popularity and increasing community and adoption Cons: - Having a central point of failure for pulling repos.. Look a

Re: [go-nuts] Re: Duplicate File Checker Performance

2016-10-21 Thread Sri G
wrote: > > Oh, I see. Well if you must read and hash every byte of every file then > you really are mostly measuring device speed. > > > > *From: *> on behalf of Sri G < > sriakhil...@gmail.com > > *Date: *Sunday, October 16, 2016 at 12:17 PM > *To: *golan

Re: [go-nuts] Re: Duplicate File Checker Performance

2016-10-16 Thread Sri G
r other purposes, the entire file must be hashed, so sadly I cant use these optimizations. On Sunday, October 16, 2016 at 1:26:24 PM UTC-4, Michael Jones wrote: > > Sri G, > > > > How does this time compare to my “Dup” program? I can’t test for you…since > it is your files

[go-nuts] Re: Duplicate File Checker Performance

2016-10-15 Thread Sri G
Thanks. Made the go code similar to python using CopyBuffer with a block size of 65536. buf := make([]byte, 65536) if _, err := io.CopyBuffer(hash, file, buf); err != nil { fmt.Println(err) } Didn't make too much of a difference, was slightly faster. What got it to the

[go-nuts] Re: Duplicate File Checker Performance

2016-10-15 Thread Sri G
try a single threaded/goroutine version in Go to replicate this level of performance and get a deeper understand of how Go is built and how to use it more effectively. Advice appreciated! On Saturday, October 15, 2016 at 5:15:29 AM UTC-4, Sri G wrote: > > I wrote a multi-threaded duplicate f

[go-nuts] Duplicate File Checker Performance

2016-10-15 Thread Sri G
I wrote a multi-threaded duplicate file checker using md5, here is the complete source: https://github.com/hbfs/dupe_check/blob/master/dupe_check.go Benched two variants on the same machine, on the same set of files (~1.7GB folder with ~600 files, each avg 3MB), multiple times, purging disk ca

[go-nuts] Re: files, readers, byte arrays (slices?), byte buffers and http.requests

2016-08-03 Thread Sri G
Doh. Thanks. I did the setup but didnt click "execute". Revisiting this because its now a bottleneck since it directly impact user experience (how long a request will take to process) and scalability (requests per second a single instance can handle). It wasn't pre-mature optimization, rather p

[go-nuts] Re: files, readers, byte arrays (slices?), byte buffers and http.requests

2016-07-02 Thread Sri G
ecksum.Sum(nil)) fmt.Println("md5=", md5hex) file.Seek(0, 0) io.Copy(f, file) It would be much appreciated if someone understands the idiomatic way to do this with and can explain it. On Saturday, July 2, 2016 at 5:48:45 PM UTC-4, Sri G wrote: > > Thanks for the pointer.

[go-nuts] Re: files, readers, byte arrays (slices?), byte buffers and http.requests

2016-07-02 Thread Sri G
Gulácsi wrote: > > > 2016. július 2., szombat 8:15:19 UTC+2 időpontban Sri G a következőt írta: >> >> I'm working on receiving uploads through a form. >> >> The tricky part is validation. >> >> I attempt to read the first 1024 bytes to check the mim

[go-nuts] files, readers, byte arrays (slices?), byte buffers and http.requests

2016-07-01 Thread Sri G
I'm working on receiving uploads through a form. The tricky part is validation. I attempt to read the first 1024 bytes to check the mime of the file and then if valid read the rest and hash it and also save it to disk. Reading the mime type is successful and I've gotten it to work by chaining