Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: pari: update to 2.13.2.
Date: Wed, 11 Aug 2021 19:12:35 +0200	[thread overview]
Message-ID: <20210811171235.7x1rFFh3kFqh3e0WyUXDK6eX2TZ8-kiqKb0fUu31GPw@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-32453@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/32453#issuecomment-897002429

Comment:
> Can you try the `-fno-semantic-interposition` compiler argument? Python has started using it for libpython for similar performance gains. I think it might allow us to keep the space gain of dynamic linking and the speed gain of static linking.

A quick informal test shows that while adding that option improves the dynamic binary a bit, it's not close to recovering what is lost from pthreads. Running the script below with the current version in the repos (no pthreads, no CFLAGS):
```
$ gp -q regress-best5.gp
4470 4491 4500 4532 4509   best=4470
```

Now with the new version, enabling pthreads:
- CFLAGS=""
gp-dyn: 5970 6000 6006 6010 6020   best=5970
gp-sta: 4219 4280 4210 4154 4203   best=4154

- CFLAGS="-flto"
gp-dyn: 6226 6168 6145 6196 6095   best=6095
gp-sta: 4166 4045 4028 4010 4013   best=4010

- CFLAGS="-flto -fno-semantic-interposition"
gp-dyn: 5669 5680 5702 5686 5628   best=5628
gp-sta: 3900 3934 4050 3921 3963   best=3900

So for this particular test, there's a 40% loss by going dynamic with `-fno-semantic-interposition` instead of 50% loss without. 

Note that we are NOT static linking system libraries. It's only `libpari` that is statically linked into the `gp` instead of being dynamically linked.

---




- regress-best_of_5.gp
```
sigmatwist1(n,k)=
{
   if(denominator(n)>1||n<=0,return(0));
   n>>=valuation(n,2);
   sumdiv(n,d,if(d%4==1,d^k,-d^k));
}

sumtwist1(k,m,N)=
{
   sigmatwist1(m/N,k-1)+2*sum(s=1,sqrtint(m),sigmatwist1((m-s^2)/N,k-1));
}

a={vector(5,i,
  gettime();
  sumtwist1(3,(10^12+4)/4,1);
  t=gettime();
  print1(t," ");
  t)};
  print("  best=",vecmin(a));
\q
```

  parent reply	other threads:[~2021-08-11 17:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11  1:45 [PR PATCH] " tornaria
2021-08-11  1:52 ` sgn
2021-08-11  3:12 ` ericonr
2021-08-11 17:12 ` tornaria [this message]
2021-08-11 17:21 ` tornaria
2021-08-11 21:22 ` [PR PATCH] [Updated] " tornaria
2021-08-12  0:09 ` ericonr
2021-08-13 13:41 ` [PR PATCH] [Updated] " tornaria
2021-08-13 15:21 ` tornaria
2021-08-14  0:44 ` [PR REVIEW] " ericonr
2021-08-14  0:44 ` ericonr
2021-08-14  0:45 ` ericonr
2021-08-14  0:45 ` ericonr
2021-08-14 17:52 ` tornaria
2021-08-14 17:55 ` tornaria
2021-08-14 17:57 ` tornaria
2021-08-14 20:29 ` ericonr
2021-08-14 23:06 ` [PR PATCH] [Updated] " tornaria
2021-08-14 23:08 ` [PR REVIEW] " tornaria
2021-08-14 23:09 ` tornaria
2021-08-14 23:10 ` tornaria
2021-08-15  3:47 ` ericonr
2021-08-15  3:48 ` [PR PATCH] [Merged]: " ericonr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210811171235.7x1rFFh3kFqh3e0WyUXDK6eX2TZ8-kiqKb0fUu31GPw@z \
    --to=tornaria@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).