Overview
| Artifact ID: | 84c5a6d30d067b3c369074e9b9aac60d063e2ccf |
|---|---|
| Ticket: | 1767293fffffffffffffffffffffffffffffffff
Bad performance using ** operator with integer operands |
| User & Date: | egavilan on 2007-08-03 19:53:50 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
When using integers with ** operand, the speed is considerably slower than if using at least one float argument. After a few runs, I get consistenly these results: % time {expr {5.0**2}} 10000 3.6763 microseconds per iteration % time {expr {5**2.0}} 10000 3.6791 microseconds per iteration % time {expr {double(5)**2}} 10000 5.4605 microseconds per iteration % time {expr {5**double(2)}} 10000 5.693 microseconds per iteration % time {expr {5**2}} 10000 38.9746 microseconds per iteration just to compare with the other "traditional" ways to obtain 5**2 % time {expr {5*5}} 10000 2.7841 microseconds per iteration % time {expr {pow(5,2)}} 10000 7.7954 microseconds per iteration % info patchlevel 8.5a6 - foundin changed to: "obsolete: 8.5a6"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "egavilan"
- subsystem changed to: "45. Parsing and Eval"
- title changed to:
Bad performance using ** operator with integer operands
- type changed to: "Bug"