vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, just FYI. I ran a profiler recently on some java code (part of which was using the postgres JDBC driver) and saw the following hotspots within the driver: org.postgresql.core.Encoding.decode (line: 193) org.postgresql.core.Encoding.decode (line: 347) I think there might be excessive new String creation at those points cause those 2 lines really light up the profiler. Best regards, --j __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| ||||
| j.random.programmer wrote: > I ran a profiler recently on some java code (part of > which was using > the postgres JDBC driver) and saw the following > hotspots within the driver: > > org.postgresql.core.Encoding.decode (line: 193) > org.postgresql.core.Encoding.decode (line: 347) > > I think there might be excessive new String creation > at those points > cause those 2 lines really light up the profiler. As pointed out by others there is not "excessive string creation" as those methods are explicitly designed to return a new String .. The issue is probably that the callers use it too much. If you attribute the cost of Encoding.decode() to its callers, what do the hotspots look like then? It looks that Encoding.getDatabaseEncoding() actually fails to return the specialized UTF8Encoding when it could, so we're still using the generic version (which works, but is slower) .. I suspect I didn't test that properly when I last modified that code. But if String creation is really the problem, then that's not going to help you anyway. -O ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| Thread Tools | |
| Display Modes | |
|
|