public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: ASSI <Stromeko@nexgo.de>
To: cygwin-apps@cygwin.com
Subject: Re: Extreme slowdown due to malloc?
Date: Tue, 22 Dec 2020 07:34:33 +0100	[thread overview]
Message-ID: <87k0tae4cm.fsf@Otto.invalid> (raw)
In-Reply-To: <012a9e3c-ec24-f307-a3c4-9f2589d54e34@maxrnd.com> (Mark Geisert's message of "Mon, 21 Dec 2020 20:37:14 -0800")

Mark Geisert writes:
>> I've been experimenting a bit with ZStandard dictionaries.  The
>> dictionary builder is probably not the most optimized piece of software
>
> Is this what leads you to suspect malloc?  Really heavy use of malloc?

That piece of code does a lot of smallish allocations when it builds up
the suffix array.  Also that is where I suspect the high number of page
faults come from as I have no other explanation.

>> The obvious difference is that I/O takes a lot longer on Cygwin
>> (roughly
>> a minute for reading all the data) and that I have an insane amount of
>> page faults on Windows (as reported by time) vs. none on Linux.
>
> How much RAM does the Windows machine have?  Do you have a paging
> file?  Is it fixed size or "let Windows manage"?  How big is it?

This machine is fully expanded to 32GiB, it won't run out of physical
memory for any of the tests shown.  The full dictionary build that I'd
wanted to have run on this machine would come in as something like
100000 in that table and takes around 6 hours consuming 15GiB on my
Linux box (4T), so if I could run that I might see a bit of memory
pressure.  The pagefile set up as fixed (I think 64GiB), but is unused.

>> While doing that I also noticed that top shows the program taking 100%
>> CPU in the multithreaded portion of the program, while it should show
>> close to 800% at that time.  I'm not sure if that information just isn't
>> available on Windows or if procps-ng needs to look someplace else for
>> that to be shown as expected.
>
> No offense, but are you sure it's actually running multi-threaded on Windows?

Yes, once it finally comes to the statistics part of the dictionary
build it'll use all eight threads no problem.  That's why it doesn't
take twice as long (wall time) at the 400 mark compared to the 200.

> I have a Cygwin malloc speedup patch that *might* help the m-t part.
> I'll prepare and submit that to cygwin-patches shortly.

Well, if you want to test it with the new ZStandard, give it a spin…
I'll check how far I can strip that test down so you can use the Cygwin
source tree for testing.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

  reply	other threads:[~2020-12-22  6:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 20:52 Achim Gratz
2020-12-22  4:37 ` Mark Geisert
2020-12-22  6:34   ` ASSI [this message]
2021-01-02 14:17     ` Achim Gratz
2021-01-18  7:07       ` Mark Geisert
2021-01-18 20:06         ` Achim Gratz

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=87k0tae4cm.fsf@Otto.invalid \
    --to=stromeko@nexgo.de \
    --cc=cygwin-apps@cygwin.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).