I'm glad it doesn't cache, since caching increases complexity and adds more
processing time and memory usage in the best case (when caching isn't
needed). Since Go encourages a "culture of competence" much more so than,
say, Java, we enjoy lower overhead (semantic overhead, at the very least),
we don't mollycoddle those who don't understand what they're doing at the
expense of those who do.
To be honest, almost all of the benchmarks (especially in blogs) that I've
seen concerning Go are from those who are just first trying out the
language, and are not in a position to do it any kind of justice. The
stress on benchmarks, for me, is a sign that they may have gotten so far as
to learn the syntax, but not the _language_, and so they don't yet know
what Go really has to offer. Those who have well integrated into the Go
mindset often do not to care either way: they know the performance is
competitive and they know how to make reasonable effort-to-efficiency
tradeoffs, and even if it was not nearly as efficient, they may still have
reservations "going back" to their previous language, since performance is
hardly our only feature.
On Tuesday, September 18, 2012 7:52:11 PM UTC-6, Jesse McNelis wrote:On Wed, Sep 19, 2012 at 11:39 AM, <brad.ry...@gmail.com <javascript:>>
wrote:
hmm, that's interesting ... because the author uses db.Query(), which uses
db.Prepare() under the covers ...
func (db *DB) Query(query string, args ...interface{}) (*Rows, error)
{
stmt, err := db.Prepare(query)
Yep, and that means it has to do a db.Prepare() for every query which
requires an additional round trip to the database.
The database driver could cache this itself, but it doesn't.
--
=====================
http://jessta.id.au --