Ask a Question related to AIX, Design and Development.
-
Spencer #1
What is more efficient (*.a or *.so) libraries?
Hi,
Recently I developed a series of static libraries (*.a files) for
performing
various different operations. I used these libraries to create CGI
script
applications - however I noticed that when I run the CGI scripts via
APACHE they were slow. Im wondering whether its because of the
loading of the *.a files when the CGI script is invoked (i.e. there are
approx
2Mb's of *.a files that need to be loaded!).
My understanding of libaries is very limited - so please bare with me.
As far as I know *.a files are loaded into memory each time an
application
is executed (at runtime). Therefore if you were to run 5 applications
that referenced the same *.a files then each library would be loaded 5
times.
(i.e. the *.a libraries when loaded into memory are not shared between
applications).
Assuming the above statement is correct then I would imagine that *.so
shared objects are more efficient. Would I be correct in thinking that
if
5 applications were invoked that referenced the same *.so files then
only
one instance of each so (shared object) would be loaded, and once loaded
it would be shared amongst the other applications. Therefore I the
system
is not having to do multiple reads of the same so file. Is this
assumption
correct?
If you have any additional advice / recommendations with regards to
using shared objects or static libaries please let me know. Anything
that
can improve the loading time of the application would be a bonus.
Best regards
Spencer
Spencer Guest
-
Efficient Table Design
Hi Guys, I have a 35 records to be store. So which design should I use? 1. Create SIngle table and store all 35 records inside the table 2.... -
Working Efficient with ID CS
Hello, A couple of weeks ago I went to a seminar of ID CS Page maker edition. I saw that ID has much more possibilities than Page maker 6.5 which... -
Looking for the most EFFICIENT way to do the following...
I have a table that has links in it. Columns: id, item, link_name, url. I want to run through the recordset of this table and so something like... -
Efficient structure
I have multiple types of information to associate to one object. I have data structures that store data structures. What is the best/most... -
Efficient query without using NOT IN clause
Hi all, I have got two tables:- a) students ======== std_id Numeric std_name Varchar(50) std_grade Varchar(10) -
Paul Pluzhnikov #2
Re: What is more efficient (*.a or *.so) libraries?
"Spencer" <spickett1234567890@hotmail.com> writes:
[Please fix your Outlook to use *reasonable* line legth. This> Recently I developed a series of static libraries (*.a files) for
> performing
> various different operations. I used these libraries to create CGI
> script
looks horrible, rest of the message reformatted.]
If these libraries are truly static, then you are quite wrong:> applications - however I noticed that when I run the CGI scripts via
> APACHE they were slow. Im wondering whether its because of the
> loading of the *.a files when the CGI script is invoked (i.e. there are
> approx 2Mb's of *.a files that need to be loaded!).
they do not get loaded at runtime. Rather, parts of them become
embedded in the an executable at link time, and you can remove them
after the exe is built without any ill effect on that executable.
Also note, that on AIX (unlike on most other UNICes), you can't
assume that libfoo.a is a static library; it may well be a shared
library, or even a mixture of shared and static parts. libc.a
is a prime example of this.
Which part exactly do you want me to bare ?-)> My understanding of libaries is very limited - so please bare with me.
This is partially correct: running 5 different apps (all using the> As far as I know *.a files are loaded into memory each time an
> application is executed (at runtime). Therefore if you were
> to run 5 applications that referenced the same *.a files then
> each library would be loaded 5 times.
same 2MB archive library) will cause that library to be loaded into
memory exactly 0 times. However, the *code* from that library, which
was linked into all of the 5 apps, will be loaded (once for each app,
if the app actually uses that code).
Yes.> Would I be correct in
> thinking that if 5 applications were invoked that referenced
> the same *.so files then only one instance of each so
>(shared object) would be loaded, and once loaded it would be
> shared amongst the other applications.
Yes. There is a further benefit: all instances of the 5 apps will> Therefore I the system
> is not having to do multiple reads of the same so file. Is this
> assumption correct?
share memory pages containing executable code of that shared library
(that's why they are called shared), reducing load on system memory.
On AIX, there is even further benefit: shared libraries on AIX are
"sticky" -- once loaded, they stay in memory, and subsequent
executions of the same (or another) app using a given shared library
may be significantly faster, then the first one.
However, creating shared libraries on AIX is a bit of a black art
(and quite different from most other UNICes), and you'll do well
to read the paper below before attempting to do that.
[url]http://www.ibm.com/servers/esdd/pdfs/aix_ll.pdf[/url]
Finally, you should first measure the time it takes for your CGI
executable to reach main() [the startup time]. If you discover
that the exe reaches main in 1 second, and then takes another 59
to produce its output, then switching to shared libraries will not
produce any measurable speedup.
Cheers,
--
In order to understand recursion you must first understand recursion.
Paul Pluzhnikov Guest



Reply With Quote

