javax.xml.bind.JAXBContext.newInstance() 很慢
今天作性能调优时发现这个问题。 在Tomcat里,这个方法执行一次居然要 6-15毫秒 (我的电脑性能还可以)。 在批量处理时这就会搞死人。 有人也发现这个问题,并提出了缓存方案。 http://robaustin.wikidot.com/how-to-improve-perforamance-of-jaxb
今天作性能调优时发现这个问题。 在Tomcat里,这个方法执行一次居然要 6-15毫秒 (我的电脑性能还可以)。 在批量处理时这就会搞死人。 有人也发现这个问题,并提出了缓存方案。 http://robaustin.wikidot.com/how-to-improve-perforamance-of-jaxb
1. It’s reading/writing data, of course 2. Members a. Attributes i. data store: get data from data source ii. data source: some url iii. item = row identity = id label = the "name" of an item (e.g. "companyName = ‘IBM’ ") attribute/value = column/value b. Operations …
Currently I don’t care for them
1. Remote Scripting is not just AJAX . There are 3 ways. a.XHR(AJAX) -> Same-Origin Limited b.iframe -> Same-Orignin Limited; It can post a file. c.Loading a script element -> Not limited to Same-Origin Policy 2. XHR with dojo a. Example dojo.xhrGet({ url: "demo/id2", handleAs: "json", handle: handler4 }); b. …
1. Select Node API a.dojo.byId() b.dojo.query("div.question p") i.The parameter here should apply to CSS3 Selector ii.This function always returns a NodeList, even if there is only one node selected 2. Attributes Operation dojo.attr(), dojo.hasAttr(), dojo.removeAttr() … 3. CSS Operation dojo.style(), dojo.hasClass(), …. 4. Insert/Remove Nodes dojo.place(newNode, parentNode, "last");… …
1. Handling dom events a.Define the event handler function alertSomeEvent(){ alert("someEvent"); } b.Connect some event to the handler function connect(){ dojo.connect(dojo.byId("someButton"),"click", alertSomeEvent); } c.Register this connection when dom tree initialization is done dojo.addOnLoad(connect); 2. Handling user-defined events It’s similar with handling dom events, only that the events here user-defined functions …
1. dojo.hitch: Takes a function as the parameter and execute it var alerter = { doAlert: function(){ alert("something"); } } dojo.hitch(alerter, doAlert); 2. Array methods: dojo.forEach(), dojo.every(), and so on 3. Type methods: dojo.isString(), dojo.isArray()… 4. Object Coping: dojo.mixin(), dojo.clone()…
1. Module(Package) name <==> the javascript file’s path/filename 2. A module is always DEFINED in a single file, althought its implemenation can go into several files 3. The "dojo" module has to be loaded before any other modules, and it’s not loaded by "dojo.require", but by the script tag <script type="text/javascript" src="xxx/dojo/dojo.js"/> 4. You …
Learning Dojo — 3.1 Core features of the Dojo language Read More »
You can use console.log("sth") to log debugging info into Firebug’s console. console.dir(someHashLiteral) is also great.
1. Three steps for installing Dojo <style type="text/css"> @import "/dojoroot/dijit/themes/tundra/tundra.css"; @import "/dojoroot/dojo/resources/dojo.css"; </style> <script type="text/javascript" src="/dojoroot/dojo/dojo.js" djConfig="parseOnLoad: true,isDebug:true"></script> <body class="tundra">… <script> dojo.require("dojo.parser"); <!– similar with "import java.util.List" –> </script> 2. Some userful Controls you may want to try TabContainer, ContentPane, ValidationTextBox 3. Ajax a. Features — Cross-Browser Compatibility and prvoiding easy-to-use APIs on …