Asking Updates from Pierre on one of his comments

49 views
Skip to first unread message

Andreas

unread,
Dec 13, 2017, 5:07:23 AM12/13/17
to brython
Pierre has said in the past:
Ok, there is the performance issue, but things are getting better ; the release I'm currently working on (3.2.7) runs the pystone test 2.5 faster than 3.2.6. It's still 15 times slower than CPython, but in the early days it was thousands of times slower.

What is the status compared to CPython today ?

Thanks a lot !

Olemis Lang

unread,
Dec 13, 2017, 6:13:09 AM12/13/17
to bry...@googlegroups.com
[...]

I will wait for others to say some about this but. Nonetheless I want
to share with you some opinions .

Performance benchmarks of Brython vs CPython could be useful to get a
idea of how a given piece of code behaves in both environments . It's
ok to get a idea of how performance changes when apps are migrated
from one environment to the another . Nonetheless ...

- Benchmark results might depend on the specific test scenarios ...
though I know Pierre uses well-known benchmarking suites
- Brython runs on top of a browser js interpreter. As such it might be
limited by the underlying js engine performance
- ... which means that results should be for "Brython running on
<BROWSER>" (in practice standard deviation might turn out to be low,
maybe not)
- ... and also that it would not be unlikely to discover that Brython
is slower than CPython since , in the later case, it is possible to go
deeper inside the interpreter to do some optimizations

Look forward to see the results :)

--
Regards,

Olemis - @olemislc

Apache™ Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net

Brython committer
http://brython.info
http://github.com/brython-dev/brython

SciPy Latin America - Ambassador

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Andreas

unread,
Dec 13, 2017, 9:30:40 AM12/13/17
to brython
Thanks for pointing these things out ! *fingers crossed* for numbers :D

Andreas

unread,
Dec 13, 2017, 9:39:13 AM12/13/17
to brython
By numbers I meant 3x times slower than CPython - that kind of thing - really good to know where we are standing.

Pierre Quentel

unread,
Dec 18, 2017, 3:11:04 AM12/18/17
to brython
I just ran the pystone test with the latest release (3.3.5), using /speed/pystone_old_versions.html :

CPython : 184038 pystones / second
Brython on Firefox : 27178 (6,77 times slower)
Brython on Chrome : 5390 (34,14 times slower)

If you clone the Brython repository, localhost:8000/speed shows the speed
of basic Python use cases (assignments, operations, functions, classes) with
Brython and with the version of CPython on the local machine.

Here are the results I get with Firefox, with 100 = time for CPython

test                             Brython
assignment                            62
augm_assign                           70
assignment_float                     155
build_dict                           135
add_dict                             209
set_dict_item                        315
build_list                            56
set_list_item                         82
add_integers                         126
add_strings                           55
str_of_int                            64
create_function_no_arg               106
create_function_single_pos_arg        94
create_function_complex_args         101
function_call                        171
function_call_complex                232
create_class_simple                  183
create_class_with_init               171
create_instance_simple_class         177
create_instance_with_init            211
call_instance_method                 854

For some of these tests, Brython is faster than CPython. For others such as
instance method calls, it is (much) slower, and unfortunately the pytone test
makes a lot of such calls.

Olemis Lang

unread,
Dec 18, 2017, 9:09:16 AM12/18/17
to bry...@googlegroups.com
On 12/18/17, Pierre Quentel <pierre....@gmail.com> wrote:
>
[...]
>
> I just ran the pystone test with the latest release (3.3.5), using
> /speed/pystone_old_versions.html :
>
> CPython : 184038 pystones / second
> Brython on Firefox : 27178 (6,77 times slower)
> Brython on Chrome : 5390 (34,14 times slower)
>
[...]
>
> Here are the results I get with Firefox, with 100 = time for CPython
>
> test Brython
[...]
> create_function_no_arg 106
> create_function_single_pos_arg 94
> create_function_complex_args 101
> function_call 171
> function_call_complex 232
> create_class_simple 183
> create_class_with_init 171
> create_instance_simple_class 177
> create_instance_with_init 211
> call_instance_method 854
>
[...]
> For others such as
> instance method calls, it is (much) slower, and unfortunately the pytone
> test
> makes a lot of such calls.
>
[...]

For me this was expected behavior considering the current
implementation . Function calls are expensive and in the current py ->
js translation there are a some layers of wrappers involved.
Reply all
Reply to author
Forward
0 new messages