Hello,
I'm making a go code which is basically parsing a lot of small xml
responses. I've noticed that right after I enable the parsing code, my R/S
as per wrk, as well as response times drop to 15% for some reason. I'm
testing with about 2000 concurrent clients and each one parses about 50
very small xmls (1 entry each).
Below is my code, does anyone have any experience/feedback with xml
decoding performance on go?
package main
import (
"encoding/xml"
"bytes"
)
type DBXML struct{
HostProperties DBXML_HostProperties
Listing DBXML_Listing
}
type DBXML_Listing struct {
sid string
Original_title string `xml:"title"`
Original_desc string `xml:"desc"`
Original_domain string `xml:"display_url"`
Original_bid float64 `xml:"bid"`
Original_URL string `xml:"clickurl"`
}
type DBXML_HostProperties struct {
Tags []DBXML_Listing `xml:"record"`
}
func (r *DBXML ) parse_response (data []byte) bool {
reader := bytes.NewReader(data)
decoder := xml.NewDecoder(reader)
decoder.Decode(&r.HostProperties);
//xml.Unmarshal(data, &r.HostProperties) // With this one i got even
less performance.
}
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.