C++ Middleware Writer

Discussion in 'C++' started by woodbrian77@gmail.com, Aug 5, 2012.

  1. Guest

    On Saturday, October 27, 2012 5:20:05 PM UTC-4, Ian Collins wrote:
    >
    >
    > Any blanket advice like that should be taken with a grain of salt.
    >
    > Every application+target environment combination is unique, so to get
    >
    > the best results, test and measure.


    I have to put something in the makefile. I switched
    it to Os from O3 based on my observations here. I also
    tested switching from O3 to Os on another program and
    found the same results -- equal run time results and
    better build times. So I decided to make Os the default
    for now. From reading about Os, it uses most of the
    O2 optimizations.
     
    , Oct 27, 2012
    #21
    1. Advertisements

  2. Guest

    <> wrote:
    > I tried a test comparing O3 and Os in the executable in
    > question. The version built with O3 took 64 seconds and the
    > Os version took 63 seconds. The O3 version is 72,472 bytes
    > and the Os version is 44,836 bytes. Also the variation in
    > executable size that I mentioned above didn't show up when
    > using Os. I'm going to start using Os and see how that goes.
    >
    > I recall someone advising me to optimize for size years ago,
    > but I needed more proof.


    O3 often contains optimizations that will increase binary size a lot and may even have negative impact on performance.
    O2 may be a good compromise between Os and O3.

    Tobi
     
    , Oct 28, 2012
    #22
    1. Advertisements

  3. Guest

    On Sunday, October 28, 2012 2:33:43 AM UTC-5, wrote:
    >
    > O3 often contains optimizations that will increase binary size a lot and may even have negative impact on performance.
    >
    > O2 may be a good compromise between Os and O3.
    >
    >


    I found this to be an interesting perspective:

    "-O3 is the highest optimization level and could
    possibly make faster code but the applications that
    benefit from it are very few, usually image and
    video decoders and such. However the side effects,
    like larger binary size, affects everything.
    Larger binaries use more memory, load slower,
    cause more disc I/O, etc. So compiling a system
    with -O3 will have the effect that a few
    applications run slightly faster at the expense
    of the rest of the system running slightly slower
    and becoming less responsive."

    The program I noticed the increase in size is a
    server that users run. It isn't expected to be
    the primary application running on a machine.
    It is likely to be one of a number of servers
    on a machine.
    It does seem that O2 or Os is a better default
    for this particular server.
     
    , Oct 28, 2012
    #23
  4. <> wrote:
    > On Sunday, October 28, 2012 2:33:43 AM UTC-5, wrote:
    >>
    >> O3 often contains optimizations that will increase binary size a lot and
    >> may even have negative impact on performance.
    >>
    >> O2 may be a good compromise between Os and O3.
    >>
    >>

    >
    > I found this to be an interesting perspective:
    >
    > "-O3 is the highest optimization level and could
    > possibly make faster code but the applications that
    > benefit from it are very few, usually image and
    > video decoders and such. However the side effects,
    > like larger binary size, affects everything.
    > Larger binaries use more memory, load slower,
    > cause more disc I/O, etc. So compiling a system
    > with -O3 will have the effect that a few
    > applications run slightly faster at the expense
    > of the rest of the system running slightly slower
    > and becoming less responsive."
    >
    > The program I noticed the increase in size is a
    > server that users run. It isn't expected to be
    > the primary application running on a machine.
    > It is likely to be one of a number of servers
    > on a machine.
    > It does seem that O2 or Os is a better default
    > for this particular server.


    [Changed my newsserver, this one seems to accept my posts. Now I don't have
    to resort to Google Groups anymore.]

    Probably O2 is a better default than O3 for almost everything, not only for
    your server.
    I think it's also what most people use.

    Tobi
     
    Tobias Müller, Oct 28, 2012
    #24
  5. Jorgen Grahn Guest

    On Sat, 2012-10-27, Ian Collins wrote:
    > On 10/28/12 08:56, wrote:
    >> On Saturday, October 27, 2012 2:01:55 PM UTC-4, Paavo Helde wrote:
    >>>
    >>>
    >>> Apparently this enabled the compiler to inline some functions which it did
    >>>
    >>> not do previously. This ought to enhance performance, at some expense of
    >>>
    >>> memory usage (and 492 bytes rounds to zero nowadays, to be honest). If you
    >>>
    >>> are indeed wanting to optimize for size, there are other compiler options
    >>>
    >>> for that (at expence of speed, of course).
    >>>
    >>>

    >>
    >> I tried a test comparing O3 and Os in the executable in
    >> question. The version built with O3 took 64 seconds and the
    >> Os version took 63 seconds. The O3 version is 72,472 bytes
    >> and the Os version is 44,836 bytes. Also the variation in
    >> executable size that I mentioned above didn't show up when
    >> using Os. I'm going to start using Os and see how that goes.

    >
    > Well what else did you expect? You told the compiler to back off on
    > inlining and it did.
    >
    >> I recall someone advising me to optimize for size years ago,
    >> but I needed more proof.

    >
    > Any blanket advice like that should be taken with a grain of salt.
    > Every application+target environment combination is unique, so to get
    > the best results, test and measure. Then use profile feedback if your
    > tools support it to squeeze out the last few percent.


    And as far as I can tell, that's as close to the truth you get. g++
    -O2 is almost always beneficial; -Os or -O3 is *probably* worth it,
    but it depends heavily on the application, and at least some on the
    exact cache sizes etc of the CPU it's executing on.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Oct 29, 2012
    #25
  6. Guest

    On Friday, October 5, 2012 8:47:10 PM UTC-5, wrote:
    > Check it out --
    >
    > http://webEbenezer.net/about.html
    >
    >
    >
    > The C++ Middleware Writer has been on line now for
    >
    > ten years.
    >
    >

    ....

    > As I mentioned earlier
    >
    > I'm thinking about dropping support for Windows in the
    >
    > middle tier. The front tier would still work on Windows.
    >
    >


    I removed the Windows support for the middle tier.
    The middle tier runs on Linux and Mac OSX and it
    should work on other UNIX flavors. The new version
    of the code --

    http://webEbenezer.net/misc/cmwAmbassador.cc

    is about 40 lines smaller without the Windows related
    code/junk. To reiterate, the front tier still works
    on Windows, but have for the time being decided to
    drop Windows support for the middle tier.


    Brian
    Ebenezer Enterprises
    http://webEbenezer.net
     
    , Jan 9, 2013
    #26
  7. æ–¼ 2013å¹´1月10日星期四UTC+8上åˆ12時49分05秒寫é“:
    > On Friday, October 5, 2012 8:47:10 PM UTC-5, wrote:
    >
    > > Check it out --

    >
    > >

    >
    > > http://webEbenezer.net/about.html

    >
    > >

    >
    > >

    >
    > >

    >
    > > The C++ Middleware Writer has been on line now for

    >
    > >

    >
    > > ten years.

    >
    > >

    >
    > >

    >
    > ...
    >
    >
    >
    > > As I mentioned earlier

    >
    > >

    >
    > > I'm thinking about dropping support for Windows in the

    >
    > >

    >
    > > middle tier. The front tier would still work on Windows.

    >
    > >

    >
    > >

    >
    >
    >
    > I removed the Windows support for the middle tier.
    >
    > The middle tier runs on Linux and Mac OSX and it
    >
    > should work on other UNIX flavors. The new version
    >
    > of the code --
    >
    >
    >
    > http://webEbenezer.net/misc/cmwAmbassador.cc
    >
    >
    >
    > is about 40 lines smaller without the Windows related
    >
    > code/junk. To reiterate, the front tier still works
    >
    > on Windows, but have for the time being decided to
    >
    > drop Windows support for the middle tier.
    >
    >
    >
    >
    >
    > Brian
    >
    > Ebenezer Enterprises
    >
    > http://webEbenezer.net

    In the user interface part, I think the O2 and Os
    switches help a lot.

    But in the heavy work horse part the O3 mode
    is required.

    Anyway it acctually depends upon the ratio of the
    interfaces and the work horses involved in the system.
     
    88888 Dihedral, Jan 10, 2013
    #27
  8. Guest

    I'm reviving a classic thread rather than starting a new
    thread. If you can provide some ideas on how to improve
    the code or documentation of C++ Middleware Writer,
    please let me know.

    I was looking at Springfuse

    http://springfuse.com

    and they say:

    "Configure Springfuse and generate your project foundation"

    I don't know their service that well, but the use of
    the word foundation seems questionable. At least for
    CMW I wouldn't describe it as providing the foundation
    of your project. I want it to be a helpful tool.


    Brian
    Ebenezer Enterprises
    http://webEbenezer.net
     
    , May 27, 2014
    #28
  9. Guest

    On Tuesday, May 27, 2014 8:51:42 PM UTC, wrote:
    >
    > http://springfuse.com
    >
    > and they say:
    >
    > "Configure Springfuse and generate your project foundation"
    >
    > I don't know their service that well, but the use of
    > the word foundation seems questionable.


    They also say "Generate an application now."

    I wouldn't be comfortable with that on my site. The CMW
    doesn't generate applications. You have to generate your
    own application. The CMW can help you build an application,
    but that's as far as I would go.

    Brian
    Ebenezer Enterprises
    http://webEbenezer.net


    >
    >
    >

    Brian
    Ebenezer Enterprises
    http://webEbenezer.net
     
    , May 27, 2014
    #29
  10. Guest

    This is a function written by the C++ Middleware Writer:

    inline void Marshal :):cmw::SendBuffer& buf
    ,uint8_t az1
    ,::cmw::marshalling_integer const& az2
    ,cui_generator const& az3
    ,int32_t msg_length_max=10000){
    try{
    buf.ReserveBytes(4);
    buf.Receive(az1);
    az2.Marshal(buf);
    az3.Marshal(buf);
    buf.FillInSize(msg_length_max);
    }catch(...){buf.PartialReset();throw;}
    }

    I'm thinking about changing the name of the function
    PartialReset to Rollback. The function resets the
    state of the buffer to what it was when the function
    started. But I'm not sure if it's a good idea to use
    Rollback outside of database context.?

    Brian
    Ebenezer Enterprises "If the foundations are destroyed,
    what can the righteous do?" Psalms 11:3
    http://webEbenezer.net
     
    , Jun 9, 2014
    #30
  11. Guest

    On Monday, June 9, 2014 3:05:55 PM UTC, wrote:
    >
    > I'm thinking about changing the name of the function
    > PartialReset to Rollback. The function resets the
    > state of the buffer to what it was when the function
    > started. But I'm not sure if it's a good idea to use
    > Rollback outside of database context.?
    >


    There are a number of older topics here that were only
    discussed a little or not at all.

    Also my middle tier, the CMW Ambassador, does synchronous
    writes to files. It is async as far as the networking
    stuff goes. I'm not sure how big of a deal that is. I
    believe the average request will amount to output (files)
    less than 20k in size. I hope that will help in terms of
    minimizing the impact of synchronous writes.?

    Brian
    Ebenezer Enterprises - "Do not rejoice when your enemy
    falls, And do not let your heart be glad when he stumbles;
    Or the L-rd will see it and be displeased, and turn His
    anger away from him." Proverbs 24:17,18

    http://webEbenezer.net
     
    , Jun 10, 2014
    #31
  12. Ike Naar Guest

    On 2014-06-09, <> wrote:
    > Ebenezer Enterprises "If the foundations are destroyed,
    > what can the righteous do?" Psalms 11:3


    You can't trust people who call themselves "righteous". Grandma 1:01
     
    Ike Naar, Jun 10, 2014
    #32
  13. Guest

    On Tuesday, June 10, 2014 8:57:10 PM UTC, Ike Naar wrote:
    > On 2014-06-09, <> wrote:
    >
    > > Ebenezer Enterprises "If the foundations are destroyed,
    > > what can the righteous do?" Psalms 11:3

    >
    > You can't trust people who call themselves "righteous". Grandma 1:01


    I beleive there are some who are counted by G-d as righteous.
    But I admit this:

    "Many a man proclaims his own loyalty, but who can find a
    trustworthy man?" Proverbs 20:6

    Some translations say goodness rather than loyalty.
     
    , Jun 10, 2014
    #33
  14. Ike Naar Guest

    On 2014-06-10, <> wrote:
    > On Tuesday, June 10, 2014 8:57:10 PM UTC, Ike Naar wrote:
    >> On 2014-06-09, <> wrote:
    >>
    >> > Ebenezer Enterprises "If the foundations are destroyed,
    >> > what can the righteous do?" Psalms 11:3

    >>
    >> You can't trust people who call themselves "righteous". Grandma 1:01

    >
    > I beleive there are some who are counted by G-d as righteous.


    Exactly. Don't trust them.
     
    Ike Naar, Jun 10, 2014
    #34
  15. Guest

    On Tuesday, June 10, 2014 9:45:44 PM UTC, Ike Naar wrote:
    > On 2014-06-10, <> wrote:
    >
    > > On Tuesday, June 10, 2014 8:57:10 PM UTC, Ike Naar wrote:

    >
    > >> On 2014-06-09, <> wrote:

    >
    > >>

    >
    > >> > Ebenezer Enterprises "If the foundations are destroyed,

    >
    > >> > what can the righteous do?" Psalms 11:3

    >
    > >>

    >
    > >> You can't trust people who call themselves "righteous". Grandma 1:01

    >
    > >

    >
    > > I beleive there are some who are counted by G-d as righteous.

    >
    > Exactly. Don't trust them.


    "So then, while we have opportunity, let us do good to all people, and especially to those who are of the household of the faith." Galatians 6:10

    Why?
     
    , Jun 10, 2014
    #35
  16. Daniel Guest

    On Tuesday, May 27, 2014 4:51:42 PM UTC-4, wrote:
    > I'm reviving a classic thread rather than starting a new
    > thread. If you can provide some ideas on how to improve
    > the code or documentation of C++ Middleware Writer,
    > please let me know.
    >


    My sense is that interest in this classic thread has waned. I also think you've already gotten a lot of good advise: one, fix up the web page, tell people what your product is, how it compares to the competition, and why anyone would want to use it; two, support standard serialization formats ratherthan proprietary formats, nobody wants to be locked into an unknown vendor; three, prefer alternatives to code generation. But you already have this feedback.

    Best of luck,
    Daniel
    https://github.com/danielaparker/jsoncons

    "Dear Sir or Madam, will you read my code?
    It took me years to write, will you take a look?
    It's a million lines, give or take a few
    I'll be writing more in a week or two
    But I need a break and I want to be a middleware writer
    Middleware writer

    Middleware writer"

    - The Beatles
     
    Daniel, Jun 11, 2014
    #36
  17. Guest

    On Wednesday, June 11, 2014 7:27:09 AM UTC-5, Daniel wrote:
    > On Tuesday, May 27, 2014 4:51:42 PM UTC-4, wrote:
    >
    > > I'm reviving a classic thread rather than starting a new

    >
    > > thread. If you can provide some ideas on how to improve

    >
    > > the code or documentation of C++ Middleware Writer,

    >
    > > please let me know.

    >
    > >

    >
    >
    >
    > My sense is that interest in this classic thread has waned. I also think you've already gotten a lot of good advise: one, fix up the web page, tell people what your product is, how it compares to the competition, and why anyone would want to use it;


    A month or two ago I did update a number of things on the
    website. I compare it to the serialization library in
    Boost.


    > two, support standard serialization formats rather than proprietary formats, nobody wants to be locked into an unknown vendor;


    I haven't found a format that encodes string lengths as variable-
    length integers. I'm not sure if there are any major
    differences between other binary protocols and mine besides
    the string lengths... for regular container sizes and message
    lengths I use 4-byte integers.

    I haven't updated this change on my website yet, but I
    plan to soon. The old figure was $500 and now it's $999.

    I'm willing to donate 15 hours/week for six months to a project
    that uses the C++ Middleware Writer.

    Also I'll pay $999 and give a $1,000 investment in my company
    to someone who helps me find someone interested in this.

    I'll pay the $999 after working for four months on the project.
    Ebenezer Enteprises works to reward investments to 3 times the
    original amount. So the investment would result in between $0 and
    $3,000, depending on how things go for the company.


    Thanks for your comments.

    Brian
    Ebenezer Enterprises
    http://webEbenezer.net
     
    , Jun 11, 2014
    #37
  18. Guest

    On Wednesday, June 11, 2014 4:56:04 PM UTC, Scott Lurndal wrote:
    >
    > Is your protocol:
    > 1) Robust (can you recover from corrupt data?)


    No.

    > 2) Secure (can you ensure that the data hasn't been corrupted)


    No. I guess this refers to checksums? I'm open to adding that.

    > 3) host-endianness transparent?


    I use receiver-makes-right.

    http://www.researchgate.net/publication/3615393_Receiver_makes_right_data_conversion_in_PVM

    > 4) compatible with existing network monitoring and data analysis tools?
    >


    No. Do you have some links on these items?

    >
    > Why would one care about the extra few dozen bytes required
    > to encode string lengths as 32-bit quantities vs. 16/8-bit?


    I think it makes sense since a lot of strings aren't very long.
    It may be a dozen bytes every time a message is sent.

    I can use the internet as much as I like, but I looked at
    a plan recently that had a 3G/month limit. That's about
    100M/day. The archive I have to download is now 20,801 bytes.
    I've worked to keep its size down and am glad to have done so
    if more limited plans are coming.?


    Brian
    Ebenezer Enterprises
    http://webEbenezer.net
     
    , Jun 11, 2014
    #38
  19. Ike Naar Guest

    On 2014-06-11, <> wrote:
    > I can use the internet as much as I like, but I looked at
    > a plan recently that had a 3G/month limit. That's about
    > 100M/day. The archive I have to download is now 20,801 bytes.
    > I've worked to keep its size down and am glad to have done so
    > if more limited plans are coming.?


    Under those conditions you can download your archive 200 times per hour,
    which seems plenty.
     
    Ike Naar, Jun 11, 2014
    #39
  20. Guest

    On Wednesday, June 11, 2014 8:12:57 PM UTC, Ike Naar wrote:
    > On 2014-06-11, <> wrote:
    > > I can use the internet as much as I like, but I looked at
    > > a plan recently that had a 3G/month limit. That's about
    > > 100M/day. The archive I have to download is now 20,801 bytes.
    > > I've worked to keep its size down and am glad to have done so
    > > if more limited plans are coming.?

    >
    > Under those conditions you can download your archive 200 times per hour,
    > which seems plenty.


    There's also the rest of the web site, my own web searching
    and some other traffic, including VOIP traffic. I don't know
    what it adds up to, but it would reduce the 200 number a lot.


    Brian
    Ebenezer Enterprises
    http://webEbenezer.net
     
    , Jun 11, 2014
    #40
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. DaVinci
    Replies:
    1
    Views:
    832
    Piotr Kobzda
    Oct 5, 2006
  2. Replies:
    1
    Views:
    539
  3. Replies:
    1
    Views:
    567
  4. Brian
    Replies:
    0
    Views:
    434
    Brian
    Nov 29, 2009
  5. Brian
    Replies:
    3
    Views:
    530
    Brian
    Feb 28, 2010
  6. Brian
    Replies:
    0
    Views:
    534
    Brian
    Apr 1, 2010
  7. Brian
    Replies:
    2
    Views:
    463
    Brian
    May 13, 2010
  8. Ebenezer
    Replies:
    0
    Views:
    319
    Ebenezer
    Jul 24, 2011
Loading...