public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: Re: [pve-devel] [PATCH common] properly encode YAML via YAML::XS
Date: Fri, 18 Sep 2020 14:35:55 +0200	[thread overview]
Message-ID: <1378deed-ac39-6db8-7eac-66cd681bdb6f@proxmox.com> (raw)
In-Reply-To: <1600412785.57pvbm8v64.astroid@nora.none>

On 9/18/20 9:13 AM, Fabian Grünbichler wrote:
> On September 17, 2020 5:06 pm, Thomas Lamprecht wrote:
>> Was this issued raised on the currently used module's upstream?
>> Maybe we/they could fix it there too, helping more than just our use
>> case.
> 
> not raised, but given the docs/description I'd say chances are rather 
> slim:
> 
>     This module implements a subset of the YAML specification for use in
>     reading and writing CPAN metadata files like META.yml and MYMETA.yml. It
>     should not be used for any other general YAML parsing or generation
>     task.
> 
> it's based on/derived from YAML::Tiny, which states:
> 
>     It only supports a very basic subset of the full YAML specification.
> 
>     Usage is targeted at files like Perl's META.yml, for which a small and
>     easily-embeddable module is extremely attractive.
> 
>     Features will only be added if they are human readable, and can be
>     written in a few lines of code. Please don't be offended if your request
>     is refused. Someone has to draw the line, and for YAML::Tiny that
>     someone is me.


ah ok, thanks for pointing that out.


>>
>>
>> That said, I have no real objection against using this XS binding of
>> libyaml-0-2.
>> btw. we get that already installed on ceph setups through the dependency
>> chain: ceph-mgr -> python3-yaml -> libyaml-0-2
> 
> install size is also very small (xs+lib are ~200kb), memory overhead 
> probably quite a bit more? we could load it only in the code-path where 
> we render yaml ;)
> 

Did some simple measurements of RSS from freshly restarted daemon/proxy workers
without client requests yet (Daemon module bases on CLIHandler which includes
CLIFormatter). I repeated them about 10 times and recorded min/max values:

pvedaemon worker:
before: max: 125072   min: 124968
after:  max: 124500   min: 124316

pveproxy worker:
before: max: 129184   min: 128816
after:  max: 128536   min: 128420

This isn't probably to significant statistically, but it actually seems that using
libyaml XS bindings saves RSS over the perl-modules CPAN one.
This comes probably mostly from the fact that it uses XSLoader[0], which allows
dynamic on-the-fly loading of libraries, so it is already only loaded once really
used.

[0]: https://perldoc.perl.org/XSLoader.html




  reply	other threads:[~2020-09-18 12:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 11:16 Fabian Grünbichler
2020-09-17 15:06 ` Thomas Lamprecht
2020-09-18  7:13   ` Fabian Grünbichler
2020-09-18 12:35     ` Thomas Lamprecht [this message]
2020-09-18 12:36 ` [pve-devel] applied: " Thomas Lamprecht

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=1378deed-ac39-6db8-7eac-66cd681bdb6f@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal