package main
import (
"fmt"
"time"
)
func foo() {
str := ""
for i := 0; i < 1000; i++ {
str += "aa"
}
}
func main() {
for i := 0; i < 200; i++ {
go func() {
for {
I suggest two things
1. Post the GODEBUG output here, someone will be able to confirm how much time
they GC is using.
2. Use github.com/pkg/profile to generate an execution trace and analyse it
with go tool trace.
--
You received this message because you are subscribed to the Google Groups
Something I've never seen addressed in the generics tradeoffs debate (not
saying it hasn't been, but I haven't see it personally) is that without
generics, you're forced to use interface{}, which just boxes the values
anyway. So you're already paying a performance cost for type-agnostic code
now In my application 48 core set GODEBUG=gctrace=1 the gc CPU percent is
17%
but my server request have many long time case
want to know the CPU percent in witch percentage is hight??
在 2017年3月27日星期一 UTC+8下午6:55:47,Dave Cheney写道:
>
>
>
> On Monday, 27 March 2017 21:12:44 UTC+11, 刘桂祥 wrote:
Thanks, yes I'm casually familiar with both projects but will dig deeper.
It's true that some big parts of what I'm describing have already been
done, targeting other languages.
On Monday, March 27, 2017 at 6:42:27 PM UTC-7, Andrew Chambers wrote:
>
> I suggest looking at the prior art of
I suggest looking at the prior art of gopherjs and Elliot stonehams haxe
based transpiler.
On 28/03/2017 2:19 PM, "Brad" wrote:
> Thanks for all feedback here. It sounds like while there are some
> significant caveats this could work and would have value. I think the big
Thanks for all feedback here. It sounds like while there are some
significant caveats this could work and would have value. I think the big
question is what are all these integration points that are provided by the
Go runtime that are not available in a C/C++ environment and how big of a
Hi,
Just wanted to know how can i achieve this.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options,
Before writing github.com/savaki/swag, I gave goswagger a try. I think
goswagger is a fantastic library with lots of useful features. However,
for my own use, I found things like:
var findTodos = runtime.OperationHandlerFunc(func(params interface{})
(interface{}, error) {
Here's an example:
8<
package main
import (
"log"
"os"
enckml "github.com/twpayne/go-geom/encoding/kml"
"github.com/twpayne/go-geom/encoding/wkbhex"
"github.com/twpayne/go-kml"
)
func main() {
g, err := wkbhex.Decode("0140004010")
if err != nil {
In addition, there are also the notion of "staging meta-compilation" as
witnessed in e.g., BER-MetaOCaml.
The idea is that if you want the best program efficiency, no compiler is
able to carry out the needed optimizations. So you start meta-compiling by
staging the compiler and generating code at
Hello all,
I have swept through the list and gone through the pkg/encoding/json
package and _believe_ I haven't missed anything, but am not 100% sure.
When encoding structures into JSON which contain slices/arrays/maps my
frontend devs consistently complain about the encoding of empty or nil
Thanks Daniel. :)
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit
On Mon, Mar 27, 2017 at 3:18 AM, wrote:
>
> For example, I have a big file, let's say 100 GB, and I need to post it to
> some http server.
>
> Could I use sendfile() upon the http client? Then I would not need to copy
> the file content into user space before sending it.
>
>
Hi All,
For example, I have a big file, let's say 100 GB, and I need to post it to
some http server.
Could I use sendfile() upon the http client? Then I would not need to copy
the file content into user space before sending it.
It seems that the http lib do not export the underlying tcp
Hi,
The codes are to send data, main func is in 'test_tool.go', calling
ParsingXml function is fine. but calling GetRemotePort, GetRemoteIp,
GetProtocol, GetSendData is wrong: "./test_tool.go:67: undefined:
GetRemotePort".
BR,
Wei Yan
--
You received this message because you are
On 03/24/2017 09:20 PM, st ov wrote:
> Is it idiomatic to mix-&-match pointer and value method receivers for
> a given type? or in *_general_*, if a single method requires a
> pointer receiver than *all methods* should take a pointer, regardless
> if a value receiver is appropriate?
>
> For
Hello st ov
What do you mean with "even though a value receiver would be acceptable" ?
Your sample code clearly shows that after foo.SetVal(1) , we still have foo.val
== 0 which looks unacceptable to me (broken setter).
Is it possible that you are confusing "is the method receiver a reference
It seems the issue has to do with the compiler inlining `foo`. If I add the
compiler directive `//go:noinline` above `foo` and run `go test` the test
fails, just like when I run `go test -covermode=atomic`. This makes sense
because if the function is inlined and the slice is allocated on the
Folks, is this something that we should do with a template processor?
More topically, is this a set of somethings that we should prototype each
of, using templates?
I'd love to see actual experiments in computer "science" (;-)) and a debate
about the tradeoffs based on code.
--dave
On
Another dimension is "intellectual complexity." Where that is smaller,
everything else is better for coding, documenting, debugging, testing,
reading, using, and maintaining.
It is a critical measure for maintaining the 'Go' of Go.
On Sun, Mar 26, 2017 at 11:40 PM Egon
On Monday, 27 March 2017 21:12:44 UTC+11, 刘桂祥 wrote:
>
> Hi Dave:
>very thanks your timely response
>two more question
>1. GODEBUG=gctrace=1 Do have some method get these quota from
> runtime package apis ?
>
no
>2. In go1.7 the concurent gc could
Hi Dave:
very thanks your timely response
two more question
1. GODEBUG=gctrace=1 Do have some method get these quota from
runtime package apis ?
2. In go1.7 the concurent gc could occupy all cpu core ?? does it
have cpu usgae limit ?
在
You can enable monitoring of the gc with this environment variable
GODEBUG=gctrace=1
The format of the output is described on this page.
https://golang.org/pkg/runtime/
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this
the gomobile wiki do not mention how to solve ios signing properly , only
with a link that can not open.
https://github.com/golang/go/wiki/Mobile
Note: target=ios requires the host machine running OS X. You need to obtain
a signing identity and download provisioning profiles
Of course you don't need to us go/ast for output (it's very likely used
heavily when working out what to generate based on Go source input) - I
generally create some simple helper types that wrap a bytes.Buffer,
generate most code using text/template into said buffer, format using
Perhaps I'm missing something in the documentation but I think this shows
something odd happening when the name in New() and the first filename in
ParseFiles() do not match:
package main
import (
"fmt"
"html/template"
"log"
"os"
)
// x.tpl contains just one
As we know go have optimise its gc stw-pause-time ,but it has some
trade-off ;
it implements concurent gc and will grab cpu resources with your
application
In some high CPU usage application, there are long time request case caused
by gc
I want to know How to monitor my application in CPU
Actually, it would be quite nice to simplify the Go's AST package and makes
it simpler for people to develop custom code generation and tools. I use
code generation quite a lot, eg. to generate data-access code, etc., but
the process of creating one requires some effort to get right. I think go
On Monday, 27 March 2017 04:06:17 UTC+3, Mandolyte wrote:
>
> I agree that it makes the suitable trade-offs. And Linq is doing pretty
> well without generics (https://github.com/ahmetb/go-linq); not familiar
> with Rx.
>
> When I consider the dilemma, the two things I don't want are slow
>
30 matches
Mail list logo