Recent

Author Topic: Meltdown and Spectre related performance degradation  (Read 16702 times)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Meltdown and Spectre related performance degradation
« Reply #15 on: January 09, 2018, 10:24:29 pm »
Please read up on spectre and meltdown issues. The cause has nothing to do with system api calls. Where do you get your information from ?

Meltdown does.  The common solution is to separate userland and kernel memory spaces, making switching between them more expensive. But the current Linux patches are provisional, some of the overhead will be fixed  by later patches using PCID on (afaik available on most 64-bit capable CPUs). The Windows patches for meltdown should already use PCID, so any slowdown over 10% is highly unlikely.

(which makes his observations really suspect, since he is using windows. Moreover, not every call from application to system leads to a syscall, there is user32.dll inbetween)

Spectre is easier, don't link scripting languages into your binary. Then nobody can execute code in your binaries, and done.

Anyway, in conclusion: measure better. The most rational conclusion is that the reboot to apply the patches caused his antivirus to go haywire.

« Last Edit: January 09, 2018, 10:27:11 pm by marcov »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Meltdown and Spectre related performance degradation
« Reply #16 on: January 09, 2018, 10:26:28 pm »
Well then tell me please what it has to do with.
It is directly bound to system api call, because most of file operations are executing on kernel level (syscall).
Spectre... meltdown

Where does it read that those are system api call related ?

They are cpu related issues. If the OS patches it in such a way that OS performance get affected then it affects the whole performance of that OS, and not for FPC alone. The implication that you try to make there simply does not make any sense (even if you would have been correct)

molly, do you contribute to fpc development? If not, please do not post in this topic, if yes, please leave the team.
FYI: yes, i have contributed (and still do) to FPC. No, I am not part of the FPC development team so you can relax about that.

I post wherever i wish to post unless one of the admins tells me to shut up.

deanon

  • New Member
  • *
  • Posts: 12
Re: Meltdown and Spectre related performance degradation
« Reply #17 on: January 09, 2018, 10:32:01 pm »
molly, ok reported

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Meltdown and Spectre related performance degradation
« Reply #18 on: January 09, 2018, 10:39:37 pm »
molly, ok reported
Purrfect !

Can't wait to hear the explanation that you couldn't share in public.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Meltdown and Spectre related performance degradation
« Reply #19 on: January 09, 2018, 10:53:54 pm »
Deanon: if you want to have an exclusive developer response file a bug, don't write in a public discussion forum.

But please provide extensive proofs and reproduction information for your problem or the response won't be much beyond an automatic "close -> Can't reproduce"


deanon

  • New Member
  • *
  • Posts: 12
Re: Meltdown and Spectre related performance degradation
« Reply #20 on: January 09, 2018, 11:33:25 pm »
Here are the measurements. I've just took my dusty old notebook (Pentium B960 2.4 ghz, 2Gb, not patched), and copied exact setup there. Build runs for less than 8 sec there (top of image).
My current desktop (i7 6700K, 4GHz, 16G, patched) builds this project for about 38 seconds (bottom of image).

(I've removed previous post because I've noticed desktop test was run with 3.0.0, but unfortunatelly, being fixed to 3.1.1 it didn't run better, so, posting again image with three screens)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Meltdown and Spectre related performance degradation
« Reply #21 on: January 10, 2018, 06:50:45 am »
The question is if the patches are the only difference. secruity software, windows version, or even just having run the command before (causing files to be cached)

Anyway, such a thing is probably not FPC related. My guess is that some system software reacts badly to the patches.

Are both cleanly installed windows versions? Anyway I guess that in the coming days more people will install the patches, and we'll see if that reacts the same.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Meltdown and Spectre related performance degradation
« Reply #22 on: January 10, 2018, 09:12:57 am »
I did a quick test here:

"Cleanup and Build" of my project, 3 times:
Without patch: 38s / 37s / 36s
With patch: 37s / 36s / 36s

So pretty the same here: Windows 10 1709, SSD, i5-4440
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Meltdown and Spectre related performance degradation
« Reply #23 on: January 10, 2018, 12:27:59 pm »
I didn't notice any drawback on my patched computers at all. Do you have antivirus enabled? Can be Windows drivers related? Another programs are running well? What Windows version are you using?

Mick

  • Jr. Member
  • **
  • Posts: 51
Re: Meltdown and Spectre related performance degradation
« Reply #24 on: January 10, 2018, 01:49:29 pm »
From what I have read today, according to Microsoft, the performance penalties of their Meltdown patches depend on 2 factors:
- operating system version
- CPU micro-architecture

For Windows 10 the performance penalty will be least significant, for Windows 7 it will be most significant. Some say it is done on purpose by Microsoft to push people still using Windows 7 or 8/8.1 to move to Windows 10. Personally I doubt it is true, but maybe I am naive...

As for the CPU micro-architecture, the situation is very similar - for the newer the micro-architectures (Skylake, Kabylake) the performance penalty should be least noticeable, while on the older (Haswell and below) - the performance penalty will be noticeable. Some say that "money talks" also in this case, but again, personally I doubt it. I believe it is due to these small improvements in the micro-architecture over the generations (the source of these 5-10% IPC increases over each generation).

This is not good news for me, because I'm still running Windows 7 on SandyBridge...

deanon

  • New Member
  • *
  • Posts: 12
Re: Meltdown and Spectre related performance degradation
« Reply #25 on: January 10, 2018, 09:48:16 pm »
Good evening all, wrong alert - the main degradation source was Windows Defender. Have no idea why it started to cause so dramatic degradation, but with added exclusions now it builds for ~10 sec (for about 9 sec with entierely disabled defender), still worse than old Pentium B960, but it is quite acceptable.

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Meltdown and Spectre related performance degradation
« Reply #26 on: January 10, 2018, 10:04:26 pm »
Good evening all, wrong alert - the main degradation source was Windows Defender. Have no idea why it started to cause so dramatic degradation, but with added exclusions now it builds for ~10 sec (for about 9 sec with entierely disabled defender), still worse than old Pentium B960, but it is quite acceptable.

You don't need to disable defender. Just add an exception to the path where lazarus and FPC lives, then problem solved.

The same happens with any antivirus software, these slow down or prevent compiling / running the newest binary.

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Meltdown and Spectre related performance degradation
« Reply #27 on: January 10, 2018, 10:14:13 pm »
Good evening all, wrong alert - the main degradation source was Windows Defender. Have no idea why it started to cause so dramatic degradation, but with added exclusions now it builds for ~10 sec (for about 9 sec with entierely disabled defender), still worse than old Pentium B960, but it is quite acceptable.
I noticed that Windows Defender became more aggressive after the 1709 update, similar to third-party antivirus. I had triggered this update manually and, therefore, I am very sure that the 1709 defender was the reason for the slow-down. Adding Lazarus and project folders to its exception list made it handsome again.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Meltdown and Spectre related performance degradation
« Reply #28 on: January 10, 2018, 10:19:46 pm »
I also updated, and ran some benchmarks before and after:

My W10 machine does is a I7-3770 12GB with SSD. Before patches (with hot SVN): 2min05 for snapshot build.  After patching 2min21

Note that another FPC developer in daenon's bugreport had no noticable slowdown with a i7-4770.

Ivy Bridge (3xxx) is on Intel's and Microsoft sh*tlist as the architecture to deprecate/replace this year (the generation that becomes 5 years old the coming year). No coincidence I guess.

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Specialize a type, not a var.

 

TinyPortal © 2005-2018