I am using cherrypy to handle get requests that pass a input parameter (basically a 32 bit string) and I use this 32 bit string to query a table in database. I observed that by default the string is in unicode and the queries takes more than 2 seconds to execute. But if I encode the string to utf-8 and then query, the execution time is around 10ms. Note that the database (mssql)'s encoding is utf-8.
Any idea why this might be happening?