Re: [go-nuts] Cast from int to uint64 performance cost

2016-10-01 Thread Agniva De Sarker
Thanks ! Appreciate the help. :) On Saturday, 1 October 2016 22:16:10 UTC+5:30, Ian Lance Taylor wrote: > > On Sat, Oct 1, 2016 at 12:24 AM, > wrote: > > > > I am using a variable to track the no. of bytes written to a file so > far. > > Now the fmt.Fprint command

Re: [go-nuts] Re: Getting some strange benchmark results

2017-08-18 Thread Agniva De Sarker
Thanks On Aug 18, 2017 1:42 PM, wrote: > From the recent GopherCon, golang's profiler has a tool for inspecting > allocations that might solve your problem. > > https://youtu.be/2557w0qsDV0?list=PLq2Nv-Sh8EbZEjZdPLaQt1qh_ohZFMDj8=526 > > -- > You received this message

[go-nuts] Getting some strange benchmark results

2017-08-17 Thread Agniva De Sarker
Hi everyone, I have a piece of code which is behaving a bit strangely in benchmarks. Here is a simplified version of it. The only difference is that in one case, the destination is a different slice. On the other case, its the same slice as source. func BenchmarkStringCreate(b *testing.B) {

[go-nuts] Re: Interest in implementing dual-pivot or 3-pivot quicksort for faster sorting?

2017-11-22 Thread Agniva De Sarker
This definitely sounds interesting. Will be glad to help out. On Wednesday, 22 November 2017 23:33:18 UTC+5:30, David McManamon wrote: > > Sometimes it takes years for great technical papers to be implemented. As > a fun exercise to compare Java's dual-pivot (since so much work went into >

Re: [go-nuts] Extensive Go resources for CS101

2018-02-03 Thread Agniva De Sarker
Really nice to hear universities taking up Go ! I hope the day comes when we don't have to learn programming by learning C anymore. On Saturday, 3 February 2018 16:00:20 UTC+5:30, Henrik Johansson wrote: > > This is good news in so many ways! Finally a useable language in > university

[go-nuts] Re: golang + wasm three times slower than javascript?

2018-08-10 Thread Agniva De Sarker
> however I expected at least equal to or better performance than JS. Hi, Unfortunately, this expectation is incorrect. Wasm is NOT guaranteed to give you better or at least equal performance to javascript. This is even in the general case when you run wasm using emcc. The performance is very

[go-nuts] Re: Ternary ... again

2018-08-14 Thread Agniva De Sarker
Your answer is here - https://tip.golang.org/doc/faq#Does_Go_have_a_ternary_form. On Tuesday, 14 August 2018 22:13:37 UTC+5:30, Mark Volkmann wrote: > > I’m new to Go and I imagine the idea of adding a ternary operator to Go > has been discussed many times. Rather than repeat that, can someone

[go-nuts] Re: Godoc command in the future http server only?

2018-09-05 Thread Agniva De Sarker
> Any way to keep that feature when godoc is going http only in future releases? Yes, that will be done. https://github.com/golang/go/issues/25595 https://github.com/golang/go/issues/26715 On Tuesday, 4 September 2018 22:03:06 UTC+5:30, Jens-Uwe Mager wrote: > > I am using the godoc command

Re: [go-nuts] Re: Is the go 1.11 godoc tool 'module-aware'?

2018-08-30 Thread Agniva De Sarker
a package path. It's a great way to generate static docs. On Friday, 31 August 2018 01:39:06 UTC+5:30, Justin Israel wrote: > > > > On Thu, Aug 30, 2018, 9:54 PM Agniva De Sarker > wrote: > >> I had filed https://github.com/golang/go/issues/26827 to list the >> ch

Re: [go-nuts] Re: Is the go 1.11 godoc tool 'module-aware'?

2018-08-30 Thread Agniva De Sarker
ohn Shahid wrote: > > > Agniva De Sarker > writes: > > > Also - note that godoc cli mode is going to go away. So "godoc -links=0 > > -html domain.com/group/project/v3/lib/foo" is not going to work after > 1.12. > > You should be using the http se

Re: [go-nuts] Re: Is the go 1.11 godoc tool 'module-aware'?

2018-08-30 Thread Agniva De Sarker
I had filed https://github.com/golang/go/issues/26827 to list the changes that godoc needs to make. Please feel free to add your comments there. Also - note that godoc cli mode is going to go away. So "godoc -links=0 -html domain.com/group/project/v3/lib/foo" is not going to work after 1.12.

[go-nuts] [Question]: Are there any plans to teach the compiler to emit VEX encoded instructions ?

2018-03-01 Thread Agniva De Sarker
Hi, I believe using the non-destructive 3 operand form will help a lot in reducing the size of binaries. And also, it might give us a good base to add FMA support and SIMD optimizations later. I have been adding fast paths to some math functions to use AVX instructions, but I was just

Re: [go-nuts] [Question]: Are there any plans to teach the compiler to emit VEX encoded instructions ?

2018-03-01 Thread Agniva De Sarker
Oops, spoke too soon. Got you now Ian. Thanks. On Mar 2, 2018 1:37 AM, "Agniva De Sarker" <agniva.quicksil...@gmail.com> wrote: > We can still support all processors. I believe it should be possible to > check for cpuid flags and conditionally emit these instructions. >

Re: [go-nuts] [Question]: Are there any plans to teach the compiler to emit VEX encoded instructions ?

2018-03-01 Thread Agniva De Sarker
We can still support all processors. I believe it should be possible to check for cpuid flags and conditionally emit these instructions. On Mar 2, 2018 12:23 AM, "Ian Lance Taylor" <i...@golang.org> wrote: > On Thu, Mar 1, 2018 at 5:05 AM, Agniva De Sarker > <agniva.qui

[go-nuts] Re: Go standard library documentation for older Go versions

2018-10-16 Thread Agniva De Sarker
Online API docs are just for the latest release and the master branch. But if you have the version you want locally installed, you can just spin up godoc and point to the goroot and browse it. > I would love it if the https://golang.org/pkg/ documentation had "introduced in version..."

[go-nuts] Re: net/http ReadRequest gives empty URL for valid HEAD request

2018-10-25 Thread Agniva De Sarker
Does not look like a valid HEAD request. It should be "HEAD / HTTP/1.1" -Agniva On Friday, 26 October 2018 00:15:14 UTC+5:30, Swapnil Mhatre wrote: > > Hi, > > I wanted to check on the forum first before filing an issue. Please see > below for the issue I am seeing. > I used a valid POSTMAN

[go-nuts] Re: Why can't I see the whole stack trace of goroutine

2018-11-08 Thread Agniva De Sarker
Have you tried Ctrl+\ ? That should dump all the goroutines. It also closes the app. If you don't want the app to shut down, then you can take a goroutine profile - https://golang.org/pkg/runtime/pprof/#Profile. On Wednesday, 7 November 2018 09:25:24 UTC+5:30, rickyu...@gmail.com wrote: > > I

Re: [go-nuts] net.TCPConn equivalent for setsockopt

2018-10-01 Thread Agniva De Sarker
On Tuesday, 2 October 2018 04:30:54 UTC+5:30, Robert Engels wrote: > > > On Oct 1, 2018, at 4:59 PM, Ian Lance Taylor > wrote: > > On Mon, Oct 1, 2018 at 1:53 PM, robert engels > wrote: > > > If you go to the TCPConn SetReadDeadline function, it states “implements > the Conn SetReadDeadline

[go-nuts] Re: wasm_exec is no error handling.

2018-09-03 Thread Agniva De Sarker
Appears to be an oversight. Will send a CL. On Monday, 3 September 2018 11:33:25 UTC+5:30, Kazuhiro Kubota wrote: > > Hi guys > > I found that wasm_exec.html does not handle error at Codelab in DevFest > tokyo 2018 ( https://tokyo2018.gdgjapan.org/ ). >

[go-nuts] Re: Updating a struct from goroutines

2018-09-26 Thread Agniva De Sarker
I think you are overcomplicating this a bit. It seems like a simple pattern of broadcasting a change to multiple agents. You send the change over a REQ-REP pair, and broadcast it to others over a PUB-SUB pair. Why do you need to copy the struct again ? Just get the struct from the REP socket

[go-nuts] Re: why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Agniva De Sarker
Here is your answer - https://tip.golang.org/doc/faq#declarations_backwards On Thursday, 20 September 2018 11:00:11 UTC+5:30, Sathish VJ wrote: > > I've been asked this question a few times and I haven't been able to find > an answer. Why does go reverse the order of variable declaration: "i

Re: [go-nuts] Re: Updating a struct from goroutines

2018-09-27 Thread Agniva De Sarker
ete. >4. Benchmarking shows it's more than fast enough for our needs. >5. The compiler catches any type mismatches instead of depending on >the runtime to report it at deserialization. > > > Sorry for the long-winded reply. I really appreciate the feedback and the > opportuni

Re: [go-nuts] When set time.Location, will be detected Data Race

2018-11-30 Thread Agniva De Sarker
Can you show us the code ? It would help Are you trying to set a variable of type time.Location ? Or are you trying to set time.Local to something else ? Like Ian said, if you want to change the location of a specific time value, use the In method. > But there are lots of place that

[go-nuts] Re: WebAssembly: Auto-generating Go bindings for javascript/DOM from the Web Standards.

2018-12-28 Thread Agniva De Sarker
Makes sense. This has been brought up before in the #webassembly channel. Don't remember what the conclusion was. But please feel free to drop in and throw some ideas around. Demand for a proper DOM API has been growing. And I think auto-generating from WebIDL files are a great way to get

[go-nuts] Re: http client POST/GET.. will not save cookie before do redirect request

2018-09-16 Thread Agniva De Sarker
On Thursday, 13 September 2018 08:15:20 UTC+5:30, Weeds Qian wrote: > > If you look at my sample code, you should know I only send one request by > http.POST, the following request is done by golang http client automaticly, > not issue by myself. > > You got the point , why the http client do

Re: [go-nuts] Run time error

2018-09-18 Thread Agniva De Sarker
You have to check the Send() method on RequestBuilder and find out where the nil pointer is coming from. There are no repro steps, nor the full stack trace, nor enough code for us to understand what is really happening. Without that it is hard to conclude why it is working on windows and not

[go-nuts] Re: Go Webassembly runs out of memory on Android

2018-09-18 Thread Agniva De Sarker
https://github.com/golang/go/issues/27462 On Tuesday, 18 September 2018 17:35:42 UTC+5:30, Tad Vizbaras wrote: > > Go Webassembly runs out of memory on Android. Very simple app with just > few event handlers. > I had to use remote debugger to see console. There is resulting screenshot. > >

[go-nuts] Re: How to use godoc with Go's module?

2019-03-26 Thread Agniva De Sarker
godoc doesn't work in module mode yet. The workaround is to create a directory resembling a GOPATH and put your project there and set the GOPATH variable to that. Tracking issue here - https://github.com/golang/go/issues/26827 On Tuesday, 26 March 2019 18:07:23 UTC+5:30, Weerasak Chongnguluam

[go-nuts] Re: wasm output and modules

2019-03-28 Thread Agniva De Sarker
ime on win7 firefox 65 box without restarting the browser. > > I'm using a wait on a Go chan, and using a defer to Release allocated > FuncOf methods. Am I missing anything else? > > Thanks, Peter > > > > On Wednesday, 27 March 2019 05:42:04 UTC+1, Agniva De Sarker wrote: >

[go-nuts] Re: Help wanted - ReferenceError: Go is not defined error

2019-04-06 Thread Agniva De Sarker
Remove the async attribute from your script tag. On Saturday, 6 April 2019 23:38:17 UTC+5:30, jon.ki...@gmail.com wrote: > > I am new to Go programming. I stumbled across a project for using > WeAssembly at https://github.com/golang/go/wiki/WebAssembly and decided > to give it a try. So I'm

[go-nuts] Re: wasm output and modules

2019-03-26 Thread Agniva De Sarker
You can use "-ldflags='-s -w'" to reduce the size, but it is expected that wasm files will be in the order of MBs (see https://golang.org/doc/go1.11#wasm). > So I was wondering if there are tools that parse the .wasm and prune unused pkgs? The size is not due to unused packages being

Re: [go-nuts] How to lower listen backlog for tcp socket

2019-03-22 Thread Agniva De Sarker
l func and syscall.SetsockoptInt(fd, syscall.AF_INET, > syscall.SO_REUSEADDR, 1) cat set reuseadd > But how to adjust listen backlog since i never find socket options for it. > > Agniva De Sarker > 于2019年3月22日周五 > 下午4:44写道: > >> Using ListenConfig is the way to go. >> >&

Re: [go-nuts] How to lower listen backlog for tcp socket

2019-03-22 Thread Agniva De Sarker
Using ListenConfig is the way to go. The Control func is passed the raw socket connection on which you can apply whatever socket options you choose. You have to go through 2 layers to get to the fd. ListenConfig{ Control: func(conn syscall.RawConn) error { return conn.Control(func(fd

Re: [go-nuts] Re: [ANN] Official Go client for Elasticsearch

2019-02-08 Thread Agniva De Sarker
Much appreciated :) On 2/8/19, Karel Minařík wrote: > It is definitely on the priorities list. The API itself is generated, so > it's a matter of adjusting potential edge cases, and a bit of > administration around branches/tags. > > Karel > > -- > You received this message because you are

[go-nuts] Re: [ANN] Official Go client for Elasticsearch

2019-02-08 Thread Agniva De Sarker
Great stuff ! > The client targets Elasticsearch 7.x. Support for 6.x and 5.x APIs will be added later. Would appreciate if this is prioritized. Our ES setup use 5.x version. We would be unable to use this client if it does not support 5.x. On Friday, 8 February 2019 16:03:37 UTC+5:30, Karel

Re: [go-nuts] Is WASM support planned in go 1.12 ?

2019-02-08 Thread Agniva De Sarker
To add to what Keith has said, Callback has been renamed to Func because the function will get called synchronously instead of being async. This is one of the major changes in 1.12. On Thursday, 7 February 2019 05:11:50 UTC+5:30, Keith Randall wrote: > > To answer the OP, wasm support is in

[go-nuts] Re: Go documentation - how to determine what implements an interface?

2019-05-16 Thread Agniva De Sarker
in ReadSeeker I should be able to see > 'Implemented by bytes.Reader etc'. > > Cheers > Peter > > On Thursday, 16 May 2019 09:50:04 UTC+2, Agniva De Sarker wrote: >> >> You can see the documentation by enabling type analysis in godoc. See >> https://golang.o

[go-nuts] Re: WASM persistent storage

2019-05-12 Thread Agniva De Sarker
There is no file I/O in the browser using Go wasm yet. Please see https://github.com/golang/go/issues/26051 On Sunday, 12 May 2019 13:56:49 UTC+2, Luis Furquim wrote: > > Hello, > > Is it possible to persist files when using Golang/WASM on a browser? I > found this page >

[go-nuts] Re: Test a Golang API on the web

2019-05-28 Thread Agniva De Sarker
I think the Heroku free tier is a great tool for this. On Monday, 27 May 2019 20:01:38 UTC+2, aimar wrote: > > Hi, > > My teacher has asked me to develop an API with Golang and test it on the > web instead of localhost. I was thinking of github.io but then I figured > out, it doesn't support

[go-nuts] Re: godoc memory leak

2019-06-17 Thread Agniva De Sarker
Couple of questions: 1. What version of godoc and Go are you using ? What is your go env ? 2. You are using -index but not passing an index file. Any reason for that ? godoc will load faster if you write an index beforehand and pass that. 3. I am guessing since you have set index_interval, you

Re: [go-nuts] Re: godoc memory leak

2019-06-18 Thread Agniva De Sarker
ring it against *top* and *docker stats. * > > The docker image is golang:1.12.0-alpine3.9 > > On Mon, Jun 17, 2019 at 9:40 PM Agniva De Sarker < > agniva.quicksil...@gmail.com> wrote: > >> Couple of questions: >> >> 1. What version of godoc and Go are you

[go-nuts] Re: Panic during proto Marshal

2019-06-19 Thread Agniva De Sarker
This happens when you are trying to access a nil pointer. Check from where the stack trace originates, go to that line and add a "!= nil" check. I guess that is what's happening. P.S. Your stack trace is in a json format which is for machines to read, not humans. While reporting issues, it

[go-nuts] Re: Concurrent Routines in WASM

2019-06-23 Thread Agniva De Sarker
The spec is at phase 2. Please feel free to subscribe to https://github.com/golang/go/issues/28631 for updates. On Saturday, 22 June 2019 06:46:56 UTC+5:30, Keith Randall wrote: > > No, it doesn't. Do wasm threads exist yet? When the wasm port was first > developed, they didn't exist. > If the

[go-nuts] Re: WASM persistent storage

2019-05-13 Thread Agniva De Sarker
> that issue, there is no current work to implement file I/O nor there are > plans to do it in the near future. Do I understand it correctly? If so, the > solution should be calling JS to persist the data? > > Again, thanks for your attention, > Luis Otavio > > Em domingo, 12 de ma

[go-nuts] Re: Go documentation - how to determine what implements an interface?

2019-05-16 Thread Agniva De Sarker
You can see the documentation by enabling type analysis in godoc. See https://golang.org/lib/godoc/analysis/help.html. Also see https://github.com/golang/go/issues/20131 On Wednesday, 15 May 2019 22:28:46 UTC+2, White Hexagon wrote: > > bytes.Reader is what I was looking for, thanks all! > >

[go-nuts] Re: How to propagate multiple errors using the new fmt.Errorf wrapping

2019-08-10 Thread Agniva De Sarker
st wondering > if this is somehow possible with the new error wrapper like it was with > https://github.com/pkg/errors. > > Am Freitag, 9. August 2019 19:35:42 UTC+2 schrieb Agniva De Sarker: >> >> I see. One way is to create a wrapper error type in layer1, which takes a >

[go-nuts] Re: running godoc in a dir outside gopath

2019-07-28 Thread Agniva De Sarker
Currently, godoc will only show documentation for GOPATH and GOROOT. Work is being done to make godoc work with modules. Feel free to subscribe to https://github.com/golang/go/issues/26827. On Monday, 29 July 2019 04:46:48 UTC+5:30, DrGo wrote: > > Hello, > > Wondering what I am doing wrong. >

Re: [go-nuts] Go Library lists

2019-08-06 Thread Agniva De Sarker
Also - https://github.com/avelino/awesome-go On Tuesday, 6 August 2019 19:35:48 UTC+5:30, Jan Mercl wrote: > > On Tue, Aug 6, 2019 at 3:51 PM > wrote: > > > If anyone knows of a currently maintained equivalent , please respond > > Check https://github.com/golang/go/wiki/Projects > -- You

[go-nuts] Re: How to propagate multiple errors using the new fmt.Errorf wrapping

2019-08-09 Thread Agniva De Sarker
This is the right way. What is the issue you are facing ? See https://tip.golang.org/pkg/errors/ for more info. You can check for Layer1Error and Layer2Error using the Is function errors.Is(err, Layer1Error) errors.Is(err, Layer2Error) On Friday, 9 August 2019 19:09:24 UTC+5:30, Alex wrote: >

[go-nuts] Re: SSA-able and canSSA meaning in Go compiler's SSA backend?

2019-09-19 Thread Agniva De Sarker
> Here is a link to a talk from a Go developer about adding SSA to the compiler That Go developer is the one who answered OP's question :) On Thursday, 19 September 2019 17:55:33 UTC+5:30, howar...@gmail.com wrote: > > Read this wiki page to understand what the goal is: >

[go-nuts] Re: Go WebAssembly(wasm) testing fails - fatal error: unexpected signal during runtime execution

2019-11-14 Thread Agniva De Sarker
Please provide more information so that it helps people to debug the issue. Such as: - Are you able to provide the code which causes this crash ? - Which Go version are you using ? - Are you testing this in the browser or in Node ? Please give details of either. On Thursday, 14 November 2019

Re: [go-nuts] Re: Go WebAssembly(wasm) testing fails - fatal error: unexpected signal during runtime execution

2019-11-14 Thread Agniva De Sarker
sts-in-the-browser > > joi, 14 noiembrie 2019, 18:33:48 UTC+2, Agniva De Sarker a scris: >> >> Please provide more information so that it helps people to debug the >> issue. Such as: >> >> - Are you able to provide the code which causes this crash ? >> - W

Re: [go-nuts] Simple worker pool in golnag

2019-12-28 Thread Agniva De Sarker
which may > be worth thinking about. > > Am Sa., 28. Dez. 2019 um 14:01 Uhr schrieb Agniva De Sarker < > agniva.quicksil...@gmail.com>: > >> > (the task was to limit the whole thing to about 10% of cores) >> >> I still don't think you needed a worker pool her

Re: [go-nuts] Simple worker pool in golnag

2019-12-28 Thread Agniva De Sarker
> (the task was to limit the whole thing to about 10% of cores) I still don't think you needed a worker pool here. Like OP mentioned above, you could just limit the number of goroutines executed to 10% of total cores. On Saturday, 28 December 2019 18:02:08 UTC+5:30, Chris Burkert wrote: > >

[go-nuts] Re: Writing bitmap data to a canvas with WebAssembly

2020-03-12 Thread Agniva De Sarker
On Wednesday, 11 March 2020 18:52:15 UTC+5:30, howar...@gmail.com wrote: > > I've no relevant experience, but I can recommend a couple of projects to > look at in the absence of anyone chiming in with actual experience: > > https://agniva.me/wasm/2018/06/18/shimmer-wasm.html >