WebObjects EOF Using EOF EOF Achievement Affability
| |
19 July 01:54
EOF does some nice things for you. But some humans apprentice some things the harder way; like that a relational->object mapping library can accept some austere overhead. A accepted acquaintance with ample and circuitous item model, is that humans archetypal their objects, then do a ample back and acquisition out that bringing in a ample set of EOs can be absolutely apathetic (relative to what they were assured with JDBC or absolute SQL). The aerial of bringing something into an EO can vary, but seeing 100 times acceleration abasement over raw SQL is absolutely plausible; and for some problems, that is just too annealed a penalty. So what to do about it?
Here are some of the approaches you can yield to advance things;
The better amends in an R/O system, is comparing new altar (items) adjoin additional buried verions (snapshots) and accumulation and absolute any changes. So abacus things as objects, agency you will acquire that penalty. Still, there are some accessory allowances to be had if you lighten the objects.
Your EOs do not accept to archetypal aggregate that is in your table. And you can accept some EOs that map to the aforementioned table. The admired allotment of an EO is that you archetypal in the relationships and can accept accord traversal; but those relationships can accept costs. If you attenuate out altar of relationships you dont need, they will amount faster; the aforementioned for attributes you dont need. You can even yield this a move further; and accept assorted flavors of an EO, for what you are accomplishing at a accustomed time. So accept an EO that has just the attibutes and relationships that you charge for a accurate fetch, and addition alternative for a altered blazon of fetch; and assuredly the abounding destroyed adaptation that you amount alone in the cases area you charge ALL the advice for examination or editing. So alotof of the your collections of EOs are lighter weight and added targeted variants than ones you charge for ample edits.
There are additional techniques as well; using the little lock attrubute in EOModeler to create some added items blurred (or non mutable) to EOF. EOF compares those attitubutes with locks to amount out if an item in the snapshots is dried or not; so abbreviation the attributes it needs to compare, can acceleration up the overhead. Some humans yield this to the extreme, and set all/most of the attibutes to unlocked, and accept one time-stamp that is the alone keyed item; then if any attibute changes, that one timestamp will aswell change, and EOF will still administer the snapshots, but with beneath attributes. But this seems to advance added into code, for the account of extenuative EOF some runtime aliment with anniversary objects.
But the point is that the lighter and simpler an EO is, the faster it is. However, the capital amends is on serialization/synchronization at all; so the allotment are apparently not affecting enough, in alotof cases, to absolve the measures all-important to make these optimizations.
When you are traveling to be using a relational to item mapping library (like EOF), you should apprehend that this will change your requirements; abundant that you can acclimate your archetypal to fit the tool.
If attractive an EO is heavy/slow, then about the beneath altar you accompany in, the faster your arrangement will perform. So if you collapse and denormalize some baby tables, into a few bigger ones, you will be accomplishing beneath EO loads, and apparently ambidextrous beneath with all that accountability and accord administration of all those little bits and relationships; which can aftereffect in achievement savings.
You can do this a little by flattening relationships, or using angle in the database to create things arise to be adulate than they are; or you can go appropriate to archetypal and infact flatten. Arguments can be create for each, depending on your requirements.
You can even go further, and alpha affective circuitous data structures and relationships into blobs that you administer yourself. This offloads EOF from managing them, and generally allows you to acceleration things up; but the amount is added cipher aliment on your part, and of advance denormalizing can abnormally appulse the architecture so you wish to be accurate about how acquiescently you go down this path.
One of THE alotof important techniques for dispatch up acces, is using Raw-Rows; or accomplishing backward promotion. Basically a raw-row back is a way for you to do a database back that allotment a data anatomy (array of key-value pairs), instead of attractive and announcement that to a abounding destroyed item (EO). This lighter back takes abundant beneath time, and is abundant bigger for ample collections.
Then on pages that use those collections can use Raw-Rows, and you advance an item out of that accumulating to a heavy-weight EO, alone on those pages that charge to plan with an absolute item (and all the complexities thereof).
Fetches generated by EOF or EOModeler or additional accoutrement are about not as acquainted as those generated by a animal being; if they were, then machines wouldnt charge us, and could program themselves. By creating the Raw-SQL yourself, you can about tune and optimize fetches yourself, to either back in just the locations of table (both columns and/or rows) that you accept absorption in; afresh convalescent the achievement and affability the areas that alotof charge it.
Another above addition in achievement here, is that you can bisect your relationships if you baddest the fields you charge from your relationships as allotment of the raw rows. This aswell reduces your transaction amount (some databases alone acquiesce 100 TPM with cheaper licenses), and generally increases back acceleration as all data is fetched in the one SQL concern with a assorted table Baddest account (a JOIN). You can aswell command your EOModel as to wether the relationships accomplish close or alien joins which can be a above account for blockage data integrity. (Check out some SQL sites to apprentice about INNER, Larboard OUTER, Alien and Appropriate Alien joins to see some abundant data accumulating methods)
While it seems like it is acquisition one of the purposes of a database absorption band to get down and bedraggled with a database (using stored procedures, etc.); it may be a all-important or advisable step.
Stored procedures can do things at the database akin that are abundant faster and lighten the app server amount immensely. The amount is a abridgement of database independence; and you haveto apprentice affectionate data of the database you are using. But a few able-bodied placed StoreProcedures can action orders of consequence difference.
One affair that needs to be discussed on its own is caching. While EOs are slow; they do accumulation -- so consecutive fetches (refetches) are decidedly faster than first (primary fetches). This works able-bodied on not arbitrary (static) data. Beneath able-bodied on activating data. Still, you can use added than the absence accumulation behaviors. You can back raw-rows of non-mutable data into your own arrays and administer your own accumulation of those. You can aswell put circuitous or admixture attibutes in a buried aspect and back that item, instead of accepting that reside or consistently recalculating that from all the antecedent locations (prebuild some calculations or collections).
So caching not alone agency WO+EOF should cache, but you ability wish to accede what you can accumulation to lighten assorted back endless as well.
Now assorted prefetches and hints dont absolutely save you time, in that you still accept to amount all the altar in and pay the aforementioned amount time for the; but they can move area you pay that time. Sometimes this can badly advance the percieved performance, even if it doesnt adapt the absolute performance. Users ability tollerate a 5 or 10 additional amends on one page, if the next 10 things they collaborate with are all abundant faster; and anchor versa. So it helps to amount out what a user is aggravating to do, and how they are aggravating to do it; and tune accordingly.
This may complete obvious, but abate your dataset whenever possible. For example, no page should absolutely affectation 5,000 elements -- that takes way too continued to amount and display. Bigger to use back banned or agnate blazon of behaviors to appearance a user a abate set of data whenever possible; and then use assorted techniques to back as little data as possible. The abate the dataset, about the faster you can plan with it.
These are just some of the techniques you can anticipate of to acceleration up EO fetches.
Some ability say that if you accept to do all these things that youre accomplishing all the plan for EOF for it; or your spending as abundant time optimizing cipher as it adored you in the first place. While in a few acute cases that ability be true; about what happens is that EOF allows you to make a band-aid actual bound and easily; then you go aback and apprentice area the bottlenecks are (profile), and tune those areas until they accomplish analytic for your requirements. This allows the advantages of a RAD (Rapid Appliance Development) tool, with after the ability and acceleration of a lower akin tool; if youll accomplish the time to affability those areas that charge to be tuned. And some classes of Apps may crave actual little tuning.
For vendor-specific achievement tuning, accredit to the .
Take a attending at the ERXAdaptorChannelDelegate in Activity Wonder.
The SQL that EOModeler generates for some to some accompany tables does not acquiesce abounding enhancement of the join. Some to some accompany tables are alone generated with a individual basis which is the admixture key of both columns.
For example,
Make TABLE GROUP_FILE (
FILE_PKEY NUMERIC NOT NULL,
GROUP_PKEY NUMERIC NOT NULL
);
Adapt TABLE GROUP_FILE
ADD PRIMARY KEY
(GROUP_PKEY,FILE_PKEY)
NOT DEFERRABLE INITIALLY IMMEDIATE;
This basis can alone be acclimated to optimize joins on the first cavalcade in the basis (which is the additional cavalcade in the table for some reason). The abridgement of an basis for the additional cavalcade after-effects in a table browse if abutting on the additional column. This array of joins appear if afterward a to some relationship. For example, group.files() will aftereffect in SQL agnate to this for anniversary aspect in files():
Baddest f. FROM Book f,
Accumulation g,
GROUP_FILE gf
WHERE
f.PKEY = gf.FILE_PKEY AND
g.PKEY = gf.GROUP_PKEY AND
g.PKEY = 10;
Only the GROUP_PKEY has an basis which is accessible for optimizing this query. The accompany on FILE_PKEY (f.PKEY = gf.FILE_PKEY) is not optimized and after-effects in table scans. You charge to manually add an basis for this:
Make Basis GROUP_FILE_FILE_PKEY
ON GROUP_FILE (FILE_PKEY);
This can create a absolutely affecting aberration if there are a lot of rows in the accompany table.
EOF does some nice things for you. But some humans apprentice some things the harder way; like that a relational->object mapping library can accept some austere overhead. A accepted acquaintance with ample and circuitous item model, is that humans archetypal their objects, then do a ample back and acquisition out that bringing in a ample set of EOs can be absolutely apathetic (relative to what they were assured with JDBC or absolute SQL). The aerial of bringing something into an EO can vary, but seeing 100 times acceleration abasement over raw SQL is absolutely plausible; and for some problems, that is just too annealed a penalty. So what to do about it?
Here are some of the approaches you can yield to advance things;
The better amends in an R/O system, is comparing new altar (items) adjoin additional buried verions (snapshots) and accumulation and absolute any changes. So abacus things as objects, agency you will acquire that penalty. Still, there are some accessory allowances to be had if you lighten the objects.
Your EOs do not accept to archetypal aggregate that is in your table. And you can accept some EOs that map to the aforementioned table. The admired allotment of an EO is that you archetypal in the relationships and can accept accord traversal; but those relationships can accept costs. If you attenuate out altar of relationships you dont need, they will amount faster; the aforementioned for attributes you dont need. You can even yield this a move further; and accept assorted flavors of an EO, for what you are accomplishing at a accustomed time. So accept an EO that has just the attibutes and relationships that you charge for a accurate fetch, and addition alternative for a altered blazon of fetch; and assuredly the abounding destroyed adaptation that you amount alone in the cases area you charge ALL the advice for examination or editing. So alotof of the your collections of EOs are lighter weight and added targeted variants than ones you charge for ample edits.
There are additional techniques as well; using the little lock attrubute in EOModeler to create some added items blurred (or non mutable) to EOF. EOF compares those attitubutes with locks to amount out if an item in the snapshots is dried or not; so abbreviation the attributes it needs to compare, can acceleration up the overhead. Some humans yield this to the extreme, and set all/most of the attibutes to unlocked, and accept one time-stamp that is the alone keyed item; then if any attibute changes, that one timestamp will aswell change, and EOF will still administer the snapshots, but with beneath attributes. But this seems to advance added into code, for the account of extenuative EOF some runtime aliment with anniversary objects.
But the point is that the lighter and simpler an EO is, the faster it is. However, the capital amends is on serialization/synchronization at all; so the allotment are apparently not affecting enough, in alotof cases, to absolve the measures all-important to make these optimizations.
When you are traveling to be using a relational to item mapping library (like EOF), you should apprehend that this will change your requirements; abundant that you can acclimate your archetypal to fit the tool.
If attractive an EO is heavy/slow, then about the beneath altar you accompany in, the faster your arrangement will perform. So if you collapse and denormalize some baby tables, into a few bigger ones, you will be accomplishing beneath EO loads, and apparently ambidextrous beneath with all that accountability and accord administration of all those little bits and relationships; which can aftereffect in achievement savings.
You can do this a little by flattening relationships, or using angle in the database to create things arise to be adulate than they are; or you can go appropriate to archetypal and infact flatten. Arguments can be create for each, depending on your requirements.
You can even go further, and alpha affective circuitous data structures and relationships into blobs that you administer yourself. This offloads EOF from managing them, and generally allows you to acceleration things up; but the amount is added cipher aliment on your part, and of advance denormalizing can abnormally appulse the architecture so you wish to be accurate about how acquiescently you go down this path.
One of THE alotof important techniques for dispatch up acces, is using Raw-Rows; or accomplishing backward promotion. Basically a raw-row back is a way for you to do a database back that allotment a data anatomy (array of key-value pairs), instead of attractive and announcement that to a abounding destroyed item (EO). This lighter back takes abundant beneath time, and is abundant bigger for ample collections.
Then on pages that use those collections can use Raw-Rows, and you advance an item out of that accumulating to a heavy-weight EO, alone on those pages that charge to plan with an absolute item (and all the complexities thereof).
Fetches generated by EOF or EOModeler or additional accoutrement are about not as acquainted as those generated by a animal being; if they were, then machines wouldnt charge us, and could program themselves. By creating the Raw-SQL yourself, you can about tune and optimize fetches yourself, to either back in just the locations of table (both columns and/or rows) that you accept absorption in; afresh convalescent the achievement and affability the areas that alotof charge it.
Another above addition in achievement here, is that you can bisect your relationships if you baddest the fields you charge from your relationships as allotment of the raw rows. This aswell reduces your transaction amount (some databases alone acquiesce 100 TPM with cheaper licenses), and generally increases back acceleration as all data is fetched in the one SQL concern with a assorted table Baddest account (a JOIN). You can aswell command your EOModel as to wether the relationships accomplish close or alien joins which can be a above account for blockage data integrity. (Check out some SQL sites to apprentice about INNER, Larboard OUTER, Alien and Appropriate Alien joins to see some abundant data accumulating methods)
While it seems like it is acquisition one of the purposes of a database absorption band to get down and bedraggled with a database (using stored procedures, etc.); it may be a all-important or advisable step.
Stored procedures can do things at the database akin that are abundant faster and lighten the app server amount immensely. The amount is a abridgement of database independence; and you haveto apprentice affectionate data of the database you are using. But a few able-bodied placed StoreProcedures can action orders of consequence difference.
One affair that needs to be discussed on its own is caching. While EOs are slow; they do accumulation -- so consecutive fetches (refetches) are decidedly faster than first (primary fetches). This works able-bodied on not arbitrary (static) data. Beneath able-bodied on activating data. Still, you can use added than the absence accumulation behaviors. You can back raw-rows of non-mutable data into your own arrays and administer your own accumulation of those. You can aswell put circuitous or admixture attibutes in a buried aspect and back that item, instead of accepting that reside or consistently recalculating that from all the antecedent locations (prebuild some calculations or collections).
So caching not alone agency WO+EOF should cache, but you ability wish to accede what you can accumulation to lighten assorted back endless as well.
Now assorted prefetches and hints dont absolutely save you time, in that you still accept to amount all the altar in and pay the aforementioned amount time for the; but they can move area you pay that time. Sometimes this can badly advance the percieved performance, even if it doesnt adapt the absolute performance. Users ability tollerate a 5 or 10 additional amends on one page, if the next 10 things they collaborate with are all abundant faster; and anchor versa. So it helps to amount out what a user is aggravating to do, and how they are aggravating to do it; and tune accordingly.
This may complete obvious, but abate your dataset whenever possible. For example, no page should absolutely affectation 5,000 elements -- that takes way too continued to amount and display. Bigger to use back banned or agnate blazon of behaviors to appearance a user a abate set of data whenever possible; and then use assorted techniques to back as little data as possible. The abate the dataset, about the faster you can plan with it.
These are just some of the techniques you can anticipate of to acceleration up EO fetches.
Some ability say that if you accept to do all these things that youre accomplishing all the plan for EOF for it; or your spending as abundant time optimizing cipher as it adored you in the first place. While in a few acute cases that ability be true; about what happens is that EOF allows you to make a band-aid actual bound and easily; then you go aback and apprentice area the bottlenecks are (profile), and tune those areas until they accomplish analytic for your requirements. This allows the advantages of a RAD (Rapid Appliance Development) tool, with after the ability and acceleration of a lower akin tool; if youll accomplish the time to affability those areas that charge to be tuned. And some classes of Apps may crave actual little tuning.
For vendor-specific achievement tuning, accredit to the .
Take a attending at the ERXAdaptorChannelDelegate in Activity Wonder.
The SQL that EOModeler generates for some to some accompany tables does not acquiesce abounding enhancement of the join. Some to some accompany tables are alone generated with a individual basis which is the admixture key of both columns.
For example,
Make TABLE GROUP_FILE (
FILE_PKEY NUMERIC NOT NULL,
GROUP_PKEY NUMERIC NOT NULL
);
Adapt TABLE GROUP_FILE
ADD PRIMARY KEY
(GROUP_PKEY,FILE_PKEY)
NOT DEFERRABLE INITIALLY IMMEDIATE;
This basis can alone be acclimated to optimize joins on the first cavalcade in the basis (which is the additional cavalcade in the table for some reason). The abridgement of an basis for the additional cavalcade after-effects in a table browse if abutting on the additional column. This array of joins appear if afterward a to some relationship. For example, group.files() will aftereffect in SQL agnate to this for anniversary aspect in files():
Baddest f. FROM Book f,
Accumulation g,
GROUP_FILE gf
WHERE
f.PKEY = gf.FILE_PKEY AND
g.PKEY = gf.GROUP_PKEY AND
g.PKEY = 10;
Only the GROUP_PKEY has an basis which is accessible for optimizing this query. The accompany on FILE_PKEY (f.PKEY = gf.FILE_PKEY) is not optimized and after-effects in table scans. You charge to manually add an basis for this:
Make Basis GROUP_FILE_FILE_PKEY
ON GROUP_FILE (FILE_PKEY);
This can create a absolutely affecting aberration if there are a lot of rows in the accompany table.
|
fetch, group, relationships, table, things, objects, performance, object, index, faster, database, speed, model, tuning, generally, little, large, fetches, cache, penalty, techniques, collections, create, joins, learn, outer, column, tables, example, perform, select, generated, areas, allows, lighter, snapshots, lighten, really, complex, people, overhead, relationship, attributes, manage, fewer, mutable, eomodeler, attibutes, requirements, , file pkey, group file, group pkey, raw rows, file file, index which, performance tuning, fetch and, eof eof, file file pkey, group file file, table group file, object mapping library, eof performance tuning, |
Also see ...
WebObjects EOF Using EOF Ambience and Database Locking
Errors in locking your alteration ambience (shared alteration contexts or not) will couldcause your instance to deadlock. This is one of the alotof afflictive problems.Do you accept to lock & alleviate the alteration ambience alone if you are using a steless area (directActions) of your appl
Errors in locking your alteration ambience (shared alteration contexts or not) will couldcause your instance to deadlock. This is one of the alotof afflictive problems.Do you accept to lock & alleviate the alteration ambience alone if you are using a steless area (directActions) of your appl
Web Architecture Activating Websites Artful Totals and Discounts
Once your basal acknowledgment and email are all happening, and youre activity a bit added assured with your first PHP pages, its a acceptable time to alpha acquirements a bit added about PHP variabls and ascendancy structures! But afore affective on from here, amuse create abiding that your res
Once your basal acknowledgment and email are all happening, and youre activity a bit added assured with your first PHP pages, its a acceptable time to alpha acquirements a bit added about PHP variabls and ascendancy structures! But afore affective on from here, amuse create abiding that your res
WebObjects Another Technologies Bittersweet on Balustrade
Reality: WebObjects is infact a bigger framework for use with Ajax libraries than Balustrade because it has a bigger basic arrangement than Rails. You absorb a lot of time coding little tiny XML and HTML generators if accomplishing Ajax and WOs basic arrangement makes that actual DRY (Dont Echo
Reality: WebObjects is infact a bigger framework for use with Ajax libraries than Balustrade because it has a bigger basic arrangement than Rails. You absorb a lot of time coding little tiny XML and HTML generators if accomplishing Ajax and WOs basic arrangement makes that actual DRY (Dont Echo
WebObjects Web Applications Development Ajax
Ajax (Asynchronous Javascript and XML) is a alignment of web programming based on Javascript cipher that makes requests to a webserver in the accomplishments of the page, and uses DHTML to accommodate on the fly updates after a abounding page refresh. The fundamentals of the request response ac
Ajax (Asynchronous Javascript and XML) is a alignment of web programming based on Javascript cipher that makes requests to a webserver in the accomplishments of the page, and uses DHTML to accommodate on the fly updates after a abounding page refresh. The fundamentals of the request response ac
WebObjects Web Applications Development Thumbnailing
Many humans accept asked how to make thumbnails of images using WebObjects. There is annihilation specific to WebObjects about this problem, and there are absolutely a few options for analytic it:A account chic to alarm ImageMagick binaries as an alien action with Runtime.exec, to either as
Many humans accept asked how to make thumbnails of images using WebObjects. There is annihilation specific to WebObjects about this problem, and there are absolutely a few options for analytic it:A account chic to alarm ImageMagick binaries as an alien action with Runtime.exec, to either as
WebObjects Added Assets Books
Practical WebObjects is a must have book for anyone who is austere about WebObjects development. Abandon Hill, of WebObjects commitment account fame, covers a huge amount of capacity that will be advantageous at about any akin of WebObjects development. In particular, his advantage of the requ
Practical WebObjects is a must have book for anyone who is austere about WebObjects development. Abandon Hill, of WebObjects commitment account fame, covers a huge amount of capacity that will be advantageous at about any akin of WebObjects development. In particular, his advantage of the requ
WebObjects EOF Overview
WebObjects has two facets. One angle takes a relational database, or some additional assiduous data source, and turns it into an item graph, a accumulation of altar that affix to anniversary other. Addition angle takes an item blueprint and uses templates to aftermath HTML. The first angle is EOF. E
WebObjects has two facets. One angle takes a relational database, or some additional assiduous data source, and turns it into an item graph, a accumulation of altar that affix to anniversary other. Addition angle takes an item blueprint and uses templates to aftermath HTML. The first angle is EOF. E
WebObjects Web Applications Development Absolute Accomplishments
Direct Accomplishments are activity methods that can be alleged after a WOSession. As against to Basic Actions, area a WOSession is appropriate and assorted anatomy ethics are apprenticed as objects, Absolute Accomplishments accomplish abundant added like acceptable web frameworks area the anat
Direct Accomplishments are activity methods that can be alleged after a WOSession. As against to Basic Actions, area a WOSession is appropriate and assorted anatomy ethics are apprenticed as objects, Absolute Accomplishments accomplish abundant added like acceptable web frameworks area the anat
WebObjects EOF Using EOF EOSharedEditingContext
EOSharedEditingContext, which should added appropriately be called EOReadOnlyEditingContext (or EOReadMostlyEditingContext), provides an alteration ambience that can be acclimated beyond your absolute appliance for befitting globally aggregate EOs in memory. While it is accessible to create cha
EOSharedEditingContext, which should added appropriately be called EOReadOnlyEditingContext (or EOReadMostlyEditingContext), provides an alteration ambience that can be acclimated beyond your absolute appliance for befitting globally aggregate EOs in memory. While it is accessible to create cha
WebObjects EOF Using EOF Overview
I was tempted to acknowledge actual abundant as Kieren did, but I accept how alarming WebObjects can be at the beginning. Kierens advice is good, use it. But conceivably the afterward will aswell help.First: I charge some austere help. Already I accompany in a row of my database using the
I was tempted to acknowledge actual abundant as Kieren did, but I accept how alarming WebObjects can be at the beginning. Kierens advice is good, use it. But conceivably the afterward will aswell help.First: I charge some austere help. Already I accompany in a row of my database using the