You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Igor Galić <i....@brainsware.org> on 2014/01/15 12:22:27 UTC

Re: git commit: TS-2495: reduce the size of HttpVCTableEntry


----- Original Message -----
> Updated Branches:
>   refs/heads/master ba44a77af -> f057cdcca
> 
> 
> TS-2495: reduce the size of HttpVCTableEntry
> 
> Reorder HttpVCTableEntry structure members to reduce the size from
> 72 to 64 bytes on 64 bit platforms.

Two questions

* Does this have an impact on our ABI compatibility?
* Are there other data structures that could use this treatment?


> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f057cdcc
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f057cdcc
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f057cdcc
> 
> Branch: refs/heads/master
> Commit: f057cdccaa8beac782028f1a8086971d46b15f95
> Parents: ba44a77
> Author: James Peach <jp...@apache.org>
> Authored: Fri Jan 10 14:47:44 2014 -0800
> Committer: James Peach <jp...@apache.org>
> Committed: Tue Jan 14 13:05:14 2014 -0800
> 
> ----------------------------------------------------------------------
>  CHANGES             |  2 ++
>  proxy/http/HttpSM.h | 14 +++++++-------
>  2 files changed, 9 insertions(+), 7 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f057cdcc/CHANGES
> ----------------------------------------------------------------------
> diff --git a/CHANGES b/CHANGES
> index 9cdcb1c..2c56ffd 100644
> --- a/CHANGES
> +++ b/CHANGES
> @@ -1,6 +1,8 @@
>                                                           -*- coding: utf-8
>                                                           -*-
>  Changes with Apache Traffic Server 4.2.0
>  
> +  *) [TS-2495] Reduce the size of HttpVCTableEntry.
> +
>    *) [TS-2491] stop other esi plugin unit test programs after error.
>     Author: Yu Qing <zh...@taobao.com>
>   
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f057cdcc/proxy/http/HttpSM.h
> ----------------------------------------------------------------------
> diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
> index 5cbfacb..ea76f9f 100644
> --- a/proxy/http/HttpSM.h
> +++ b/proxy/http/HttpSM.h
> @@ -97,23 +97,20 @@ extern ink_mutex debug_sm_list_mutex;
>  struct HttpVCTableEntry
>  {
>    VConnection *vc;
> -  bool eos;
>    MIOBuffer *read_buffer;
>    MIOBuffer *write_buffer;
>    VIO *read_vio;
>    VIO *write_vio;
>    HttpSMHandler vc_handler;
>    HttpVC_t vc_type;
> +  bool eos;
>    bool in_tunnel;
>  };
>  
> -const int vc_table_max_entries = 4;
> -
>  struct HttpVCTable
>  {
> -
> +  static const int vc_table_max_entries = 4;
>    HttpVCTable();
> -  HttpVCTableEntry vc_table[vc_table_max_entries];
>  
>    HttpVCTableEntry *new_entry();
>    HttpVCTableEntry *find_entry(VConnection *);
> @@ -121,11 +118,14 @@ struct HttpVCTable
>    void remove_entry(HttpVCTableEntry *);
>    void cleanup_entry(HttpVCTableEntry *);
>    void cleanup_all();
> -  bool is_table_clear();
> +  bool is_table_clear() const;
> +
> +private:
> +  HttpVCTableEntry vc_table[vc_table_max_entries];
>  };
>  
>  inline bool
> -HttpVCTable::is_table_clear()
> +HttpVCTable::is_table_clear() const
>  {
>    for (int i = 0; i < vc_table_max_entries; i++) {
>      if (vc_table[i].vc != NULL) {
> 
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 8716 7A9F 989B ABD5 100F  4008 F266 55D6 2998 1641


Re: git commit: TS-2495: reduce the size of HttpVCTableEntry

Posted by James Peach <jp...@apache.org>.
On Jan 15, 2014, at 3:22 AM, Igor Galić <i....@brainsware.org> wrote:

> 
> 
> ----- Original Message -----
>> Updated Branches:
>>  refs/heads/master ba44a77af -> f057cdcca
>> 
>> 
>> TS-2495: reduce the size of HttpVCTableEntry
>> 
>> Reorder HttpVCTableEntry structure members to reduce the size from
>> 72 to 64 bytes on 64 bit platforms.
> 
> Two questions
> 
> * Does this have an impact on our ABI compatibility?

Nope.

> * Are there other data structures that could use this treatment?

I expect so. pahole(1) does the analysis, so it's probably possible to spend an afternoon finding them.

> 
> 
>> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f057cdcc
>> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f057cdcc
>> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f057cdcc
>> 
>> Branch: refs/heads/master
>> Commit: f057cdccaa8beac782028f1a8086971d46b15f95
>> Parents: ba44a77
>> Author: James Peach <jp...@apache.org>
>> Authored: Fri Jan 10 14:47:44 2014 -0800
>> Committer: James Peach <jp...@apache.org>
>> Committed: Tue Jan 14 13:05:14 2014 -0800
>> 
>> ----------------------------------------------------------------------
>> CHANGES             |  2 ++
>> proxy/http/HttpSM.h | 14 +++++++-------
>> 2 files changed, 9 insertions(+), 7 deletions(-)
>> ----------------------------------------------------------------------
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f057cdcc/CHANGES
>> ----------------------------------------------------------------------
>> diff --git a/CHANGES b/CHANGES
>> index 9cdcb1c..2c56ffd 100644
>> --- a/CHANGES
>> +++ b/CHANGES
>> @@ -1,6 +1,8 @@
>>                                                          -*- coding: utf-8
>>                                                          -*-
>> Changes with Apache Traffic Server 4.2.0
>> 
>> +  *) [TS-2495] Reduce the size of HttpVCTableEntry.
>> +
>>   *) [TS-2491] stop other esi plugin unit test programs after error.
>>    Author: Yu Qing <zh...@taobao.com>
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f057cdcc/proxy/http/HttpSM.h
>> ----------------------------------------------------------------------
>> diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
>> index 5cbfacb..ea76f9f 100644
>> --- a/proxy/http/HttpSM.h
>> +++ b/proxy/http/HttpSM.h
>> @@ -97,23 +97,20 @@ extern ink_mutex debug_sm_list_mutex;
>> struct HttpVCTableEntry
>> {
>>   VConnection *vc;
>> -  bool eos;
>>   MIOBuffer *read_buffer;
>>   MIOBuffer *write_buffer;
>>   VIO *read_vio;
>>   VIO *write_vio;
>>   HttpSMHandler vc_handler;
>>   HttpVC_t vc_type;
>> +  bool eos;
>>   bool in_tunnel;
>> };
>> 
>> -const int vc_table_max_entries = 4;
>> -
>> struct HttpVCTable
>> {
>> -
>> +  static const int vc_table_max_entries = 4;
>>   HttpVCTable();
>> -  HttpVCTableEntry vc_table[vc_table_max_entries];
>> 
>>   HttpVCTableEntry *new_entry();
>>   HttpVCTableEntry *find_entry(VConnection *);
>> @@ -121,11 +118,14 @@ struct HttpVCTable
>>   void remove_entry(HttpVCTableEntry *);
>>   void cleanup_entry(HttpVCTableEntry *);
>>   void cleanup_all();
>> -  bool is_table_clear();
>> +  bool is_table_clear() const;
>> +
>> +private:
>> +  HttpVCTableEntry vc_table[vc_table_max_entries];
>> };
>> 
>> inline bool
>> -HttpVCTable::is_table_clear()
>> +HttpVCTable::is_table_clear() const
>> {
>>   for (int i = 0; i < vc_table_max_entries; i++) {
>>     if (vc_table[i].vc != NULL) {
>> 
>> 
> 
> -- 
> Igor Galić
> 
> Tel: +43 (0) 664 886 22 883
> Mail: i.galic@brainsware.org
> URL: http://brainsware.org/
> GPG: 8716 7A9F 989B ABD5 100F  4008 F266 55D6 2998 1641