mysetup is being called here:

times = timeit.Timer(stmt="from __main__ import
concat",setup="gc.enable();from __main__ import
mysetup").repeat(7,loops)

Look at "from __main__ import mysetup" after gc.enable(); gc,enable()
according to timeit rules needs to be called
before the setup function. Are you saying Ian that I only import but never
call mysetup() ? Perhaps you are right but I followed examples and this is
what I thought was correct (maybe not).

Ayan, so you are seeing similar results with Python 2.7 ? I purposely
avoided Python 2.7 because it doesn't support Unicode well - it's a kludge
hack. So I wanted to compare Python 3 to Golang, which were both designed
with Unicode functionality from the start.

I'm baffled that Golang is so much slower than Python. I must be doing
something wrong ?

Shubha


On Mon, Feb 27, 2017 at 4:21 PM, Ian Lance Taylor <i...@golang.org> wrote:

> On Mon, Feb 27, 2017 at 3:58 PM, Shubha Ramani <shubharam...@gmail.com>
> wrote:
> > Please see the attached two scripts.
> >
> > Use python3 for concat_test.py.
> >
> > I'm getting 591 nsec for the micro benchmark in python and 4453 ns for
> the
> > microbenchmark in go.
> > I stole this benchmark from Unicode.py of pybench, but changed it a bit.
> >
> > (py36env) shubha@shubha-Z170X-UD5:~/myperformance$ go test
> > --bench=UnicodeConcat
> > BenchmarkUnicodeConcat-8          300000              4453 ns/op
> >
> > (py36env) shubha@shubha-Z170X-UD5:~/myperformance$ python concat_test.py
> > time_taken = 591.0059640882537 nsec
>
> I'm no Python expert, but I don't see any evidence that your Python
> code is actually executing either mysetup or concat.
>
> Ian
>

-- 
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 https://groups.google.com/d/optout.

Reply via email to