All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
       [not found] <1407334428-7601-1-git-send-email-jonathan.r.julien@gmail.com>
@ 2014-08-06 14:49 ` Simon Marchi
       [not found] ` <CAFXXi0nEyJzZ4YJv-pw7hPJfRq7LzzuLWG-_TrChpa8er1cqKA@mail.gmail.com>
  2014-08-16 14:43 ` David Goulet
  2 siblings, 0 replies; 8+ messages in thread
From: Simon Marchi @ 2014-08-06 14:49 UTC (permalink / raw)
  To: Jonathan Rajotte Julien; +Cc: lttng-dev

On 6 August 2014 10:13, Jonathan Rajotte Julien
<jonathan.r.julien@gmail.com> wrote:
> The presence of tabulation and newline in mi is irrelevant and
> can impact client performance. The parsing & processing of a lot of data from mi
> with many /t and /n impact performance. This aim to fix the problem at the
> source. Style is useless for machine.

Just by curiosity, did you manage to put a number on that performance impact?

> Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
> ---
>  src/bin/lttng-sessiond/save.c | 2 +-
>  src/common/config/config.c    | 8 ++++----
>  src/common/config/config.h    | 5 ++++-
>  src/common/mi-lttng.c         | 2 +-
>  4 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
> index 90b3a3b..28844e3 100644
> --- a/src/bin/lttng-sessiond/save.c
> +++ b/src/bin/lttng-sessiond/save.c
> @@ -1514,7 +1514,7 @@ int save_session(struct ltt_session *session,
>         }
>         file_opened = 1;
>
> -       writer = config_writer_create(fd);
> +       writer = config_writer_create(fd, 1);
>         if (!writer) {
>                 ret = LTTNG_ERR_NOMEM;
>                 goto end;
> diff --git a/src/common/config/config.c b/src/common/config/config.c
> index bfb2576..1dccd26 100644
> --- a/src/common/config/config.c
> +++ b/src/common/config/config.c
> @@ -353,7 +353,7 @@ end:
>  }
>
>  LTTNG_HIDDEN
> -struct config_writer *config_writer_create(int fd_output)
> +struct config_writer *config_writer_create(int fd_output, int indent)
>  {
>         int ret;
>         struct config_writer *writer;
> @@ -379,12 +379,12 @@ struct config_writer *config_writer_create(int fd_output)
>
>         ret = xmlTextWriterSetIndentString(writer->writer,
>                 BAD_CAST config_xml_indent_string);
> -       if (ret)  {
> +       if (ret) {
>                 goto error_destroy;
>         }
>
> -       ret = xmlTextWriterSetIndent(writer->writer, 1);
> -       if (ret)  {
> +       ret = xmlTextWriterSetIndent(writer->writer, indent);
> +       if (ret) {
>                 goto error_destroy;
>         }
>
> diff --git a/src/common/config/config.h b/src/common/config/config.h
> index 9a5671a..2fed612 100644
> --- a/src/common/config/config.h
> +++ b/src/common/config/config.h
> @@ -81,11 +81,14 @@ int config_parse_value(const char *value);
>   * fd_output File to which the XML content must be written. The file will be
>   * closed once the config_writer has been destroyed.
>   *
> + * indent If other than 0 the XML will be pretty printed
> + * with indentation and newline.
> + *
>   * Returns an instance of a configuration writer on success, NULL on
>   * error.
>   */
>  LTTNG_HIDDEN
> -struct config_writer *config_writer_create(int fd_output);
> +struct config_writer *config_writer_create(int fd_output, int indent);
>
>  /*
>   * Destroy an instance of a configuration writer.
> diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
> index a636c71..31fa610 100644
> --- a/src/common/mi-lttng.c
> +++ b/src/common/mi-lttng.c
> @@ -352,7 +352,7 @@ struct mi_writer *mi_lttng_writer_create(int fd_output, int mi_output_type)
>                 goto end;
>         }
>         if (mi_output_type == LTTNG_MI_XML) {
> -               mi_writer->writer = config_writer_create(fd_output);
> +               mi_writer->writer = config_writer_create(fd_output, 0);
>                 if (!mi_writer->writer) {
>                         goto err_destroy;
>                 }
> --
> 2.0.0
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
       [not found] ` <CAFXXi0nEyJzZ4YJv-pw7hPJfRq7LzzuLWG-_TrChpa8er1cqKA@mail.gmail.com>
@ 2014-08-06 15:34   ` Alexandre Montplaisir
  2014-08-06 18:40   ` Jonathan Rajotte-Julien
  1 sibling, 0 replies; 8+ messages in thread
From: Alexandre Montplaisir @ 2014-08-06 15:34 UTC (permalink / raw)
  To: Simon Marchi, Jonathan Rajotte Julien; +Cc: lttng-dev


On 08/06/2014 10:49 AM, Simon Marchi wrote:
> On 6 August 2014 10:13, Jonathan Rajotte Julien
> <jonathan.r.julien@gmail.com> wrote:
>> The presence of tabulation and newline in mi is irrelevant and
>> can impact client performance. The parsing & processing of a lot of data from mi
>> with many /t and /n impact performance. This aim to fix the problem at the
>> source. Style is useless for machine.
> Just by curiosity, did you manage to put a number on that performance impact?

50

>
>> Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
>> ---
>>   src/bin/lttng-sessiond/save.c | 2 +-
>>   src/common/config/config.c    | 8 ++++----
>>   src/common/config/config.h    | 5 ++++-
>>   src/common/mi-lttng.c         | 2 +-
>>   4 files changed, 10 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
>> index 90b3a3b..28844e3 100644
>> --- a/src/bin/lttng-sessiond/save.c
>> +++ b/src/bin/lttng-sessiond/save.c
>> @@ -1514,7 +1514,7 @@ int save_session(struct ltt_session *session,
>>          }
>>          file_opened = 1;
>>
>> -       writer = config_writer_create(fd);
>> +       writer = config_writer_create(fd, 1);
>>          if (!writer) {
>>                  ret = LTTNG_ERR_NOMEM;
>>                  goto end;
>> diff --git a/src/common/config/config.c b/src/common/config/config.c
>> index bfb2576..1dccd26 100644
>> --- a/src/common/config/config.c
>> +++ b/src/common/config/config.c
>> @@ -353,7 +353,7 @@ end:
>>   }
>>
>>   LTTNG_HIDDEN
>> -struct config_writer *config_writer_create(int fd_output)
>> +struct config_writer *config_writer_create(int fd_output, int indent)
>>   {
>>          int ret;
>>          struct config_writer *writer;
>> @@ -379,12 +379,12 @@ struct config_writer *config_writer_create(int fd_output)
>>
>>          ret = xmlTextWriterSetIndentString(writer->writer,
>>                  BAD_CAST config_xml_indent_string);
>> -       if (ret)  {
>> +       if (ret) {
>>                  goto error_destroy;
>>          }
>>
>> -       ret = xmlTextWriterSetIndent(writer->writer, 1);
>> -       if (ret)  {
>> +       ret = xmlTextWriterSetIndent(writer->writer, indent);
>> +       if (ret) {
>>                  goto error_destroy;
>>          }
>>
>> diff --git a/src/common/config/config.h b/src/common/config/config.h
>> index 9a5671a..2fed612 100644
>> --- a/src/common/config/config.h
>> +++ b/src/common/config/config.h
>> @@ -81,11 +81,14 @@ int config_parse_value(const char *value);
>>    * fd_output File to which the XML content must be written. The file will be
>>    * closed once the config_writer has been destroyed.
>>    *
>> + * indent If other than 0 the XML will be pretty printed
>> + * with indentation and newline.
>> + *
>>    * Returns an instance of a configuration writer on success, NULL on
>>    * error.
>>    */
>>   LTTNG_HIDDEN
>> -struct config_writer *config_writer_create(int fd_output);
>> +struct config_writer *config_writer_create(int fd_output, int indent);
>>
>>   /*
>>    * Destroy an instance of a configuration writer.
>> diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
>> index a636c71..31fa610 100644
>> --- a/src/common/mi-lttng.c
>> +++ b/src/common/mi-lttng.c
>> @@ -352,7 +352,7 @@ struct mi_writer *mi_lttng_writer_create(int fd_output, int mi_output_type)
>>                  goto end;
>>          }
>>          if (mi_output_type == LTTNG_MI_XML) {
>> -               mi_writer->writer = config_writer_create(fd_output);
>> +               mi_writer->writer = config_writer_create(fd_output, 0);
>>                  if (!mi_writer->writer) {
>>                          goto err_destroy;
>>                  }
>> --
>> 2.0.0
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
       [not found] ` <CAFXXi0nEyJzZ4YJv-pw7hPJfRq7LzzuLWG-_TrChpa8er1cqKA@mail.gmail.com>
  2014-08-06 15:34   ` Alexandre Montplaisir
@ 2014-08-06 18:40   ` Jonathan Rajotte-Julien
  1 sibling, 0 replies; 8+ messages in thread
From: Jonathan Rajotte-Julien @ 2014-08-06 18:40 UTC (permalink / raw)
  To: lttng-dev

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

Hey,

Here by client I refer about end user MI client like TMF(Trace Compass).

Take the later case. Where a pretty MI output impose drastic performance problem.

Some of the problems are internal to TMF but inherent to how java parse XML (in compliance with the XML specification). This patch aim to feed a client with a minify (web buzzword reference Yay!) XML to minimize the need of manipulation on the client side.

The benchmark are currently from TMF and for the interpretation/parsing of lttng list -k. In java \t \n and any whitespace between node are considered node... so parsing become quite heavy.

Here some graphs: See attached document or here http://imgur.com/Wn78rJV

We can see that even if the problem is how we do it in TMF a minify MI is always better and by far when parsing.

We can also compare it to normal output parsing (via regexp) which TMF currently use. There seem to have little gain compare to the text version. The gain is simply simplicity. The use of regexp is limited(*for must of us) and cumbersome.

I tried to see if other utility such as xmllint where affected by whitespace etc. but the difference seems minimal.

If a developer need a prettify version of MI output they can use lttng <mi_command> | xmllint --format -

Cheers,
Jonathan

On 08/06/2014 10:49 AM, Simon Marchi wrote:
> On 6 August 2014 10:13, Jonathan Rajotte Julien
> <jonathan.r.julien@gmail.com> wrote:
>> The presence of tabulation and newline in mi is irrelevant and
>> can impact client performance. The parsing & processing of a lot of data from mi
>> with many /t and /n impact performance. This aim to fix the problem at the
>> source. Style is useless for machine.
> 
> Just by curiosity, did you manage to put a number on that performance impact?
> 
>> Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
>> ---
>>  src/bin/lttng-sessiond/save.c | 2 +-
>>  src/common/config/config.c    | 8 ++++----
>>  src/common/config/config.h    | 5 ++++-
>>  src/common/mi-lttng.c         | 2 +-
>>  4 files changed, 10 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
>> index 90b3a3b..28844e3 100644
>> --- a/src/bin/lttng-sessiond/save.c
>> +++ b/src/bin/lttng-sessiond/save.c
>> @@ -1514,7 +1514,7 @@ int save_session(struct ltt_session *session,
>>         }
>>         file_opened = 1;
>>
>> -       writer = config_writer_create(fd);
>> +       writer = config_writer_create(fd, 1);
>>         if (!writer) {
>>                 ret = LTTNG_ERR_NOMEM;
>>                 goto end;
>> diff --git a/src/common/config/config.c b/src/common/config/config.c
>> index bfb2576..1dccd26 100644
>> --- a/src/common/config/config.c
>> +++ b/src/common/config/config.c
>> @@ -353,7 +353,7 @@ end:
>>  }
>>
>>  LTTNG_HIDDEN
>> -struct config_writer *config_writer_create(int fd_output)
>> +struct config_writer *config_writer_create(int fd_output, int indent)
>>  {
>>         int ret;
>>         struct config_writer *writer;
>> @@ -379,12 +379,12 @@ struct config_writer *config_writer_create(int fd_output)
>>
>>         ret = xmlTextWriterSetIndentString(writer->writer,
>>                 BAD_CAST config_xml_indent_string);
>> -       if (ret)  {
>> +       if (ret) {
>>                 goto error_destroy;
>>         }
>>
>> -       ret = xmlTextWriterSetIndent(writer->writer, 1);
>> -       if (ret)  {
>> +       ret = xmlTextWriterSetIndent(writer->writer, indent);
>> +       if (ret) {
>>                 goto error_destroy;
>>         }
>>
>> diff --git a/src/common/config/config.h b/src/common/config/config.h
>> index 9a5671a..2fed612 100644
>> --- a/src/common/config/config.h
>> +++ b/src/common/config/config.h
>> @@ -81,11 +81,14 @@ int config_parse_value(const char *value);
>>   * fd_output File to which the XML content must be written. The file will be
>>   * closed once the config_writer has been destroyed.
>>   *
>> + * indent If other than 0 the XML will be pretty printed
>> + * with indentation and newline.
>> + *
>>   * Returns an instance of a configuration writer on success, NULL on
>>   * error.
>>   */
>>  LTTNG_HIDDEN
>> -struct config_writer *config_writer_create(int fd_output);
>> +struct config_writer *config_writer_create(int fd_output, int indent);
>>
>>  /*
>>   * Destroy an instance of a configuration writer.
>> diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
>> index a636c71..31fa610 100644
>> --- a/src/common/mi-lttng.c
>> +++ b/src/common/mi-lttng.c
>> @@ -352,7 +352,7 @@ struct mi_writer *mi_lttng_writer_create(int fd_output, int mi_output_type)
>>                 goto end;
>>         }
>>         if (mi_output_type == LTTNG_MI_XML) {
>> -               mi_writer->writer = config_writer_create(fd_output);
>> +               mi_writer->writer = config_writer_create(fd_output, 0);
>>                 if (!mi_writer->writer) {
>>                         goto err_destroy;
>>                 }
>> --
>> 2.0.0
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

[-- Attachment #2: performanceMiMinify.ods --]
[-- Type: application/vnd.oasis.opendocument.spreadsheet, Size: 30997 bytes --]

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
       [not found] <1407334428-7601-1-git-send-email-jonathan.r.julien@gmail.com>
  2014-08-06 14:49 ` [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation Simon Marchi
       [not found] ` <CAFXXi0nEyJzZ4YJv-pw7hPJfRq7LzzuLWG-_TrChpa8er1cqKA@mail.gmail.com>
@ 2014-08-16 14:43 ` David Goulet
  2 siblings, 0 replies; 8+ messages in thread
From: David Goulet @ 2014-08-16 14:43 UTC (permalink / raw)
  To: Jonathan Rajotte Julien; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 3462 bytes --]

Merged

On 06 Aug (10:13:48), Jonathan Rajotte Julien wrote:
> The presence of tabulation and newline in mi is irrelevant and
> can impact client performance. The parsing & processing of a lot of data from mi
> with many /t and /n impact performance. This aim to fix the problem at the
> source. Style is useless for machine.
> 
> Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
> ---
>  src/bin/lttng-sessiond/save.c | 2 +-
>  src/common/config/config.c    | 8 ++++----
>  src/common/config/config.h    | 5 ++++-
>  src/common/mi-lttng.c         | 2 +-
>  4 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
> index 90b3a3b..28844e3 100644
> --- a/src/bin/lttng-sessiond/save.c
> +++ b/src/bin/lttng-sessiond/save.c
> @@ -1514,7 +1514,7 @@ int save_session(struct ltt_session *session,
>  	}
>  	file_opened = 1;
>  
> -	writer = config_writer_create(fd);
> +	writer = config_writer_create(fd, 1);
>  	if (!writer) {
>  		ret = LTTNG_ERR_NOMEM;
>  		goto end;
> diff --git a/src/common/config/config.c b/src/common/config/config.c
> index bfb2576..1dccd26 100644
> --- a/src/common/config/config.c
> +++ b/src/common/config/config.c
> @@ -353,7 +353,7 @@ end:
>  }
>  
>  LTTNG_HIDDEN
> -struct config_writer *config_writer_create(int fd_output)
> +struct config_writer *config_writer_create(int fd_output, int indent)
>  {
>  	int ret;
>  	struct config_writer *writer;
> @@ -379,12 +379,12 @@ struct config_writer *config_writer_create(int fd_output)
>  
>  	ret = xmlTextWriterSetIndentString(writer->writer,
>  		BAD_CAST config_xml_indent_string);
> -	if (ret)  {
> +	if (ret) {
>  		goto error_destroy;
>  	}
>  
> -	ret = xmlTextWriterSetIndent(writer->writer, 1);
> -	if (ret)  {
> +	ret = xmlTextWriterSetIndent(writer->writer, indent);
> +	if (ret) {
>  		goto error_destroy;
>  	}
>  
> diff --git a/src/common/config/config.h b/src/common/config/config.h
> index 9a5671a..2fed612 100644
> --- a/src/common/config/config.h
> +++ b/src/common/config/config.h
> @@ -81,11 +81,14 @@ int config_parse_value(const char *value);
>   * fd_output File to which the XML content must be written. The file will be
>   * closed once the config_writer has been destroyed.
>   *
> + * indent If other than 0 the XML will be pretty printed
> + * with indentation and newline.
> + *
>   * Returns an instance of a configuration writer on success, NULL on
>   * error.
>   */
>  LTTNG_HIDDEN
> -struct config_writer *config_writer_create(int fd_output);
> +struct config_writer *config_writer_create(int fd_output, int indent);
>  
>  /*
>   * Destroy an instance of a configuration writer.
> diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
> index a636c71..31fa610 100644
> --- a/src/common/mi-lttng.c
> +++ b/src/common/mi-lttng.c
> @@ -352,7 +352,7 @@ struct mi_writer *mi_lttng_writer_create(int fd_output, int mi_output_type)
>  		goto end;
>  	}
>  	if (mi_output_type == LTTNG_MI_XML) {
> -		mi_writer->writer = config_writer_create(fd_output);
> +		mi_writer->writer = config_writer_create(fd_output, 0);
>  		if (!mi_writer->writer) {
>  			goto err_destroy;
>  		}
> -- 
> 2.0.0
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 603 bytes --]

[-- Attachment #2: Type: text/plain, Size: 155 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
@ 2014-08-07 17:14 Thibault, Daniel
  0 siblings, 0 replies; 8+ messages in thread
From: Thibault, Daniel @ 2014-08-07 17:14 UTC (permalink / raw)
  To: lttng-dev

----------------------------------------------------------------------
Date: Thu, 07 Aug 2014 11:47:59 -0400
From: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Re: Message-ID: <53E39FAF.9060904@voxpopuli.im>

> I was expecting Jonathan to explain it further in his upcoming reply ;)
>
> But from the numbers I've seen from his benchmark, it was overall 50 
> times faster when using the minified XML than using the "pretty-printed" 
> one.
> Mainly from:
> - Not having to concatenate all the outputted strings into one
> - Not having to iterate (MANY times) on empty XML nodes

> Alexandre
----------------------------------------------------------------------
   Fifty times faster!?  Impressive.

Daniel U. Thibault
Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
RDDC - Centre de recherches de Valcartier | DRDC - Valcartier Research Centre
2459 route de la Bravoure
Québec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
       [not found] <48CF5AC71E61DB46B70D0F388054EFFD3CCB4810@VAL-E-01.valcartier.drdc-rddc.gc.ca>
@ 2014-08-07 15:47 ` Alexandre Montplaisir
  0 siblings, 0 replies; 8+ messages in thread
From: Alexandre Montplaisir @ 2014-08-07 15:47 UTC (permalink / raw)
  To: Thibault, Daniel, lttng-dev

I was expecting Jonathan to explain it further in his upcoming reply ;)

But from the numbers I've seen from his benchmark, it was overall 50 
times faster when using the minified XML than using the "pretty-printed" 
one.
Mainly from:
- Not having to concatenate all the outputted strings into one
- Not having to iterate (MANY times) on empty XML nodes

Cheers,
Alexandre

On 08/07/2014 09:09 AM, Thibault, Daniel wrote:
> ----------------------------------------------------------------------
> Date: Wed, 06 Aug 2014 11:34:39 -0400
> From: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
> To: Simon Marchi <simon.marchi@polymtl.ca>,  Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
>
> On 08/06/2014 10:49 AM, Simon Marchi wrote:
>> Just by curiosity, did you manage to put a number on that performance impact?
> 50
> ----------------------------------------------------------------------
>
>     Fifty what?  Furlongs per fortnight?  If dimensionless, what is it?
>
> Daniel U. Thibault
> Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
> Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
> RDDC - Centre de recherches de Valcartier | DRDC - Valcartier Research Centre
> 2459 route de la Bravoure
> Québec QC  G3J 1X5
> CANADA
> Vox : (418) 844-4000 x4245
> Fax : (418) 844-4538
> NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
> Gouvernement du Canada | Government of Canada
> <http://www.valcartier.drdc-rddc.gc.ca/>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
@ 2014-08-07 13:09 Thibault, Daniel
  0 siblings, 0 replies; 8+ messages in thread
From: Thibault, Daniel @ 2014-08-07 13:09 UTC (permalink / raw)
  To: lttng-dev

----------------------------------------------------------------------
Date: Wed, 06 Aug 2014 11:34:39 -0400
From: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
To: Simon Marchi <simon.marchi@polymtl.ca>,  Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>

On 08/06/2014 10:49 AM, Simon Marchi wrote:
> Just by curiosity, did you manage to put a number on that performance impact?

50
----------------------------------------------------------------------

   Fifty what?  Furlongs per fortnight?  If dimensionless, what is it?

Daniel U. Thibault
Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
RDDC - Centre de recherches de Valcartier | DRDC - Valcartier Research Centre
2459 route de la Bravoure
Québec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation
@ 2014-08-06 14:13 Jonathan Rajotte Julien
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Rajotte Julien @ 2014-08-06 14:13 UTC (permalink / raw)
  To: lttng-dev

The presence of tabulation and newline in mi is irrelevant and
can impact client performance. The parsing & processing of a lot of data from mi
with many /t and /n impact performance. This aim to fix the problem at the
source. Style is useless for machine.

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
---
 src/bin/lttng-sessiond/save.c | 2 +-
 src/common/config/config.c    | 8 ++++----
 src/common/config/config.h    | 5 ++++-
 src/common/mi-lttng.c         | 2 +-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
index 90b3a3b..28844e3 100644
--- a/src/bin/lttng-sessiond/save.c
+++ b/src/bin/lttng-sessiond/save.c
@@ -1514,7 +1514,7 @@ int save_session(struct ltt_session *session,
 	}
 	file_opened = 1;
 
-	writer = config_writer_create(fd);
+	writer = config_writer_create(fd, 1);
 	if (!writer) {
 		ret = LTTNG_ERR_NOMEM;
 		goto end;
diff --git a/src/common/config/config.c b/src/common/config/config.c
index bfb2576..1dccd26 100644
--- a/src/common/config/config.c
+++ b/src/common/config/config.c
@@ -353,7 +353,7 @@ end:
 }
 
 LTTNG_HIDDEN
-struct config_writer *config_writer_create(int fd_output)
+struct config_writer *config_writer_create(int fd_output, int indent)
 {
 	int ret;
 	struct config_writer *writer;
@@ -379,12 +379,12 @@ struct config_writer *config_writer_create(int fd_output)
 
 	ret = xmlTextWriterSetIndentString(writer->writer,
 		BAD_CAST config_xml_indent_string);
-	if (ret)  {
+	if (ret) {
 		goto error_destroy;
 	}
 
-	ret = xmlTextWriterSetIndent(writer->writer, 1);
-	if (ret)  {
+	ret = xmlTextWriterSetIndent(writer->writer, indent);
+	if (ret) {
 		goto error_destroy;
 	}
 
diff --git a/src/common/config/config.h b/src/common/config/config.h
index 9a5671a..2fed612 100644
--- a/src/common/config/config.h
+++ b/src/common/config/config.h
@@ -81,11 +81,14 @@ int config_parse_value(const char *value);
  * fd_output File to which the XML content must be written. The file will be
  * closed once the config_writer has been destroyed.
  *
+ * indent If other than 0 the XML will be pretty printed
+ * with indentation and newline.
+ *
  * Returns an instance of a configuration writer on success, NULL on
  * error.
  */
 LTTNG_HIDDEN
-struct config_writer *config_writer_create(int fd_output);
+struct config_writer *config_writer_create(int fd_output, int indent);
 
 /*
  * Destroy an instance of a configuration writer.
diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c
index a636c71..31fa610 100644
--- a/src/common/mi-lttng.c
+++ b/src/common/mi-lttng.c
@@ -352,7 +352,7 @@ struct mi_writer *mi_lttng_writer_create(int fd_output, int mi_output_type)
 		goto end;
 	}
 	if (mi_output_type == LTTNG_MI_XML) {
-		mi_writer->writer = config_writer_create(fd_output);
+		mi_writer->writer = config_writer_create(fd_output, 0);
 		if (!mi_writer->writer) {
 			goto err_destroy;
 		}
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-16 14:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1407334428-7601-1-git-send-email-jonathan.r.julien@gmail.com>
2014-08-06 14:49 ` [PATCH lttng-tool] Mi & save/load: add option to indent or not on config writer creation Simon Marchi
     [not found] ` <CAFXXi0nEyJzZ4YJv-pw7hPJfRq7LzzuLWG-_TrChpa8er1cqKA@mail.gmail.com>
2014-08-06 15:34   ` Alexandre Montplaisir
2014-08-06 18:40   ` Jonathan Rajotte-Julien
2014-08-16 14:43 ` David Goulet
2014-08-07 17:14 Thibault, Daniel
     [not found] <48CF5AC71E61DB46B70D0F388054EFFD3CCB4810@VAL-E-01.valcartier.drdc-rddc.gc.ca>
2014-08-07 15:47 ` Alexandre Montplaisir
  -- strict thread matches above, loose matches on Subject: below --
2014-08-07 13:09 Thibault, Daniel
2014-08-06 14:13 Jonathan Rajotte Julien

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.