Bill Allombert on Thu, 03 Jul 2025 09:20:33 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: question on execution time for qfbsolve
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: question on execution time for qfbsolve
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Thu, 3 Jul 2025 09:20:27 +0200
- Delivery-date: Thu, 03 Jul 2025 09:20:33 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1751527231; bh=mO2R43liBcYXl0GQ8/ZTSbJ1ck/dbzfyTHDqQ+MKoq4=; h=Date:From:To:Subject:References:In-Reply-To:From; b=dGS8+E0xSK1qzqE5MHYmw47OOBU6LOMCAhRLUscrZ4W3AfTpa9C6XVkDzSHe0HdM9 6RNwe3I5CAUFoqWbYRTEYTewjwnbV8+q0FH6gyY2Yy2fUPxvG1T+nqE2rUJ3ia4nMs U49gQrH8R9u+3rZzu2dX9NAZdoaE6f1knj0Q+QTovC2gq9VOs5y5BxBjhwytTU88q2 GbeFDn6pA4epzi+Vby0p9e5Xel0D/dQOVxE0QSTeSD2GjS/kUlvHVQ7RZvwcj4byup 22NWO38bMrWducEPoz7zl6EhWLzLSvwpLSJEKsTsW+rCQCADXYSvW/3VxGRq6AlSgt lDK04QODh9Vp58aM/lFgIe97WxIuRDq2s6B8C8my1ssCzvo7EXG90TAFVlLiuaOChU kGsi+L5TeE8c69rxJa9aG5z6m/K+NF/G0hdC60Vh65TgoNHSqjCAlc3oMAh5+YKwqT +H7DCFAcWi+xgh5xozJznrMy2j/n0shYs1Zp45wLIMgz5ziJscpzMWkCgqOEOdq9Xt DcuXZ6Zyy6paL+xOe5mWp+9qsalNcn/BkyKzbRNU1PaZ6U/oqoOWrtZ0Y6ZCFNqCvA mJyBK+FngymeI+d1pz/Ha2WWTR8gh+RPM33JtfAS+zbxStrWtAr87KtJ08bCrzP8Rp LKfC3F9cE/W3Qe5wc4kVIwnk=
- In-reply-to: <a9584670-1def-4fac-813e-1c7f47205524@gmail.com>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <fb1dccec-3050-40df-86f6-b3153ac7b5f7@gmail.com> <a9584670-1def-4fac-813e-1c7f47205524@gmail.com>
On Wed, Jul 02, 2025 at 08:14:09PM -0700, American Citizen wrote:
> I ran over the first 100,000 integers
>
> ? for(i=1,100000,qfbsolve(Qfb(1,0,1),i,3))
> cpu time = 3,394 ms, real time = 3,394 ms.
> ? for(i=1,100000,qfbsolve(Qfb(1,0,1),[i,factor(i)],3))
> cpu time = 3,348 ms, real time = 3,348 ms.
>
> so it is about the same, not much improvement, 46 milliseconds.
Of course since you are including the time to factor i!
The point is to avoid factoring i again when its factorization is already
known.
For example:
? #
? forfactored(i=1,1000000,qfbsolve(Qfb(1,0,1),i,3))
*** last result computed in 2,767 ms.
? for(i=1,1000000,qfbsolve(Qfb(1,0,1),i,3))
*** last result computed in 2,994 ms.
? for(i=1,1000000,qfbsolve(Qfb(1,0,1),[i,factor(i)],3))
*** last result computed in 3,131 ms.
Of course for small numbers, it should not make a lot of difference.
Cheers,
Bill.