[New-bugs-announce] [issue46233] Minor speedup for bigint squaring

Tim Peters report at bugs.python.org
Sun Jan 2 17:48:26 EST 2022


New submission from Tim Peters <tim at python.org>:

longobject.c's x_mul()'s special code for squaring gets kind of sloppy at the end of a digit pass, doing a useless add of 0 and an "extra" test for carry. Easily cleaned up.

I think the underlying cause is that the HAC algorithm description it was modeled on was quite "hand wavy" about how badly, and exactly when, the carry can exceed a single digit. Things are better-behaved at the end of a digit pass.

----------
assignee: tim.peters
components: Interpreter Core
messages: 409534
nosy: tim.peters
priority: normal
severity: normal
stage: needs patch
status: open
title: Minor speedup for bigint squaring
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46233>
_______________________________________


More information about the New-bugs-announce mailing list