C++ Middleware Writer


W

woodbrian77

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.
 
Ad

Advertisements

T

troplin

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
 
W

woodbrian77

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.
 
T

Tobias Müller

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
 
J

Jorgen Grahn

Well what else did you expect? You told the compiler to back off on
inlining and it did.


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
 
W

woodbrian77

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
 
Ad

Advertisements

8

88888 Dihedral

(e-mail address removed)æ–¼ 2013å¹´1月10日星期四UTC+8上åˆ12時49分05秒寫é“:
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.
 
W

woodbrian77

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
 
W

woodbrian77

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
 
W

woodbrian77

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
 
W

woodbrian77

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
 
Ad

Advertisements

I

Ike Naar

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
 
W

woodbrian77

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.
 
W

woodbrian77

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?
 
D

Daniel

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
 
Ad

Advertisements

W

woodbrian77

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
 
W

woodbrian77

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
 
I

Ike Naar

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.
 
Ad

Advertisements

W

woodbrian77

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
 

Ask a Question

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. After that, you can post your question and our members will help you out.

Ask a Question

Top