TS
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<!--/*MIDDLE*/-->
<div id="middle">
<div id="middle-container">
<!--#Include file="include_menu_eshop.asp"-->
<div id="eshop-container">
<% If NOT rsElenco.recordcount=0 then 'CONTROLLO SUPERFLUO
CONTA_ARTICOLI = 1
CONTA_RISULTATI = 1
'PRIMO CICLO DI COSTRUZIONE DELLA VARIABILE PER LA VISUALIZZAZIONE DEL CAPTION IMAGE Do while
not rsElenco.eof STRINGA_CAPTION=S TRINGA_CAPTION & "'CAPTION_"&rsElenco(
"ID_ARTICOLO")& "'," 'PROSEGUO IL CICLO DI COSTRUZIONE DELLA VARIABILE
rsElenco.Movenext
Loop
rsElenco.Movefirst
%>
<script type="text/javascript" src="<%=URL%>/js/jquery.caption.js"></script> <%'<!--/*caption
images*/-->
%>
<script type="text/javascript">
<!--
$(document).ready(function() {
var caption = [ < %= LEFT(STRINGA_CAPTION, LEN(STRINGA_CAPTION) - 1) % > ];
$.each(caption, function(i, val) {
$('#' + val + '').contenthover({
data_selector: '.eshop-article-list-caption',
overlay_height: 55,
effect: 'slide',
slide_speed: 300,
overlay_background: '<%If NOT cInt(LOGIN_STAGIONE_ESHOP) = 10 then response.Write("#f6f6f6") else response.Write("#fff")%>',
overlay_opacity: 0.8
});
});
});
// -->
</script>
<% Do while not rsElenco.eof 'INIZIO IL CICLO DEGLI ARTICOLI
'-----------------------------------------------------------------------------------
'APERTURA STORED PROCEDURE sp_ESHOP_Article_Sheet E RECUPERO IL PREZZO DELL'ARTICOLO '-----------------------------------------------------------------------------------
Set cmd_sp_ESHOP_Article_Sheet = Server.CreateObject("ADODB.Command")
set rsPrezzo = server.createobject("ADODB.recordset")
rsPrezzo.CursorLocation = 3
With cmd_sp_ESHOP_Article_Sheet
.ActiveConnection = cnConn
.CommandText = "sp_ESHOP_Article_Sheet"
.CommandType = 4
.Parameters.Append .CreateParameter("@id_stato", 3, 1, , FixSQL(cInt(LOGIN_STATO)))
.Parameters.Append .CreateParameter("@id_lingua", 3, 1, , FixSQL(cInt(LOGIN_LINGUA)))
.Parameters.Append .CreateParameter("@id_articolo", 3, 1, , FixSQL(cDbl(rsElenco("ID_ARTICOLO"))))
.Parameters.Append .CreateParameter("@id_categoria", 3, 1, , FixSQL(cInt(ID_CATEGORIA)))
.Parameters.Append .CreateParameter("@id_taglia", 3, 1, , 0)
.Parameters.Append .CreateParameter("@id_colore", 3, 1, , 0)
.Parameters.Append .CreateParameter("@id_utente", 3, 1, , FixSQL(cDbl(LOGIN_UTENTE_ID)))
.Parameters.Append .CreateParameter("@visualizza_articolo", 3, 1, , 0)
End With
rsPrezzo.Open cmd_sp_ESHOP_Article_Sheet
'SE SIAMO A GIA ' 5 ARTICOLI VISUALIZZATI ELIMINO LO SPAZIO IN FONDO (CHE C'E ' GIA' DA DIV
CONTENITORE) E TOLGO IL MARGINE DESTRO DI 10 PIXEL ALLA FOTO If cInt(CONTA_RISULTATI)=5
then SPACE_RIGHT="style=" "margin:0px" "" %>
<div id="eshop-article-list" <%=SPACE_RIGHT%>
>
<a href="<%=URL&" / "&rsPrezzo("URL_REWRITE ")%>" style="text-decoration:none">
<img src="<%=URL%>/cgi-bin/article/<%=rsElenco("IMG_COVER")%>" id="CAPTION_<%=rsElenco("ID_ARTICOLO")%>" width="180" height="270" border="0" title="<%=rsElenco("DESCRIZIONE")%>"/>
<div class="eshop-article-list-caption">
<strong><%=Label(4,LOGIN_LINGUA)%>. <span style="color:#6b6b6b"><%=rsElenco("CODICE_ARTICOLO")%></span></strong><br />
<%
If isNull(rsPrezzo("SCONTO_TIPOLOGIA")) then response.Write("<strong>"&formatCurrency(cCur(rsPrezzo("PREZZO_VENDITA")),2)&"</strong>") else response.Write("<span style=""color:#6b6b6b; text-decoration:line-through"">"&formatCurrency(cCur(rsPrezzo("PREZZO_VENDITA")),2)&"</span> <strong>"&formatCurrency(cCur(rsPrezzo("PREZZO_PAGATO")),2)&"</strong>")
If cInt(rsElenco("PRENOTABILE")) = 1 then response.Write("<br /><span class=""eshop-article-booking"">"&Label(38,LOGIN_LINGUA)&"</span>")
%>
</div>
</a>
<div class="clear" style="margin-bottom:10px">
</div>
<a href="<%=URL&" / "&rsElenco("URL_REWRITE ")%>"><%=rsElenco("DESCRIZIONE")%></a>
</div>
<% 'RIGA A CAPO + VISUALIZZAZIONE RIGA DI SEPARAZIONE
If cInt(rsElenco.recordcount) > 5 then
If cInt(CONTA_RISULTATI) = 5 AND NOT cInt(rsElenco.recordcount) = cInt(CONTA_ARTICOLI) then
response.Write("<div class=""clear""></div><div class=""eshop-article-line""></div>") & chr(13) & chr(10)
CONTA_RISULTATI = 0
end if
end if
'AGGIORNO LE VARIABILI PER IL CICLO SUCCESSIVO SPACE_RIGHT="" CONTA_RISULTATI=c Int(CONTA_RISULTATI)
+ 1 CONTA_ARTICOLI=c Int(CONTA_ARTICOLI) + 1 'CHIUDO IL CONTROLLO SU RSPREZZO RECORDCOUNT
rsPrezzo.Close
Set rsPrezzo = nothing
Set cmd_sp_ESHOP_Article_Sheet = nothing
'PROSEGUO IL CICLO DEGLI ARTICOLI rsElenco.Movenext loop rsElenco.Movefirst end if 'CHIUDO IL CONTROLLO SU RSELENCO RECORDCOUNT
rsElenco.Close
Set rsElenco = nothing
Set cmd_sp_ESHOP_Search_Article = nothing
%>
</div>
</div>
Preparation code output
<% If NOT rsElenco.recordcount=0 then 'CONTROLLO SUPERFLUO
CONTA_ARTICOLI = 1
CONTA_RISULTATI = 1
'PRIMO CICLO DI COSTRUZIONE DELLA VARIABILE PER LA VISUALIZZAZIONE DEL CAPTION IMAGE Do while
not rsElenco.eof STRINGA_CAPTION=S TRINGA_CAPTION & "'CAPTION_"&rsElenco(
"ID_ARTICOLO")& "'," 'PROSEGUO IL CICLO DI COSTRUZIONE DELLA VARIABILE
rsElenco.Movenext
Loop
rsElenco.Movefirst
%>
<%'
%>
<% Do while not rsElenco.eof 'INIZIO IL CICLO DEGLI ARTICOLI
'-----------------------------------------------------------------------------------
'APERTURA STORED PROCEDURE sp_ESHOP_Article_Sheet E RECUPERO IL PREZZO DELL'ARTICOLO '-----------------------------------------------------------------------------------
Set cmd_sp_ESHOP_Article_Sheet = Server.CreateObject("ADODB.Command")
set rsPrezzo = server.createobject("ADODB.recordset")
rsPrezzo.CursorLocation = 3
With cmd_sp_ESHOP_Article_Sheet
.ActiveConnection = cnConn
.CommandText = "sp_ESHOP_Article_Sheet"
.CommandType = 4
.Parameters.Append .CreateParameter("@id_stato", 3, 1, , FixSQL(cInt(LOGIN_STATO)))
.Parameters.Append .CreateParameter("@id_lingua", 3, 1, , FixSQL(cInt(LOGIN_LINGUA)))
.Parameters.Append .CreateParameter("@id_articolo", 3, 1, , FixSQL(cDbl(rsElenco("ID_ARTICOLO"))))
.Parameters.Append .CreateParameter("@id_categoria", 3, 1, , FixSQL(cInt(ID_CATEGORIA)))
.Parameters.Append .CreateParameter("@id_taglia", 3, 1, , 0)
.Parameters.Append .CreateParameter("@id_colore", 3, 1, , 0)
.Parameters.Append .CreateParameter("@id_utente", 3, 1, , FixSQL(cDbl(LOGIN_UTENTE_ID)))
.Parameters.Append .CreateParameter("@visualizza_articolo", 3, 1, , 0)
End With
rsPrezzo.Open cmd_sp_ESHOP_Article_Sheet
'SE SIAMO A GIA ' 5 ARTICOLI VISUALIZZATI ELIMINO LO SPAZIO IN FONDO (CHE C'E ' GIA' DA DIV
CONTENITORE) E TOLGO IL MARGINE DESTRO DI 10 PIXEL ALLA FOTO If cInt(CONTA_RISULTATI)=5
then SPACE_RIGHT="style=" "margin:0px" "" %>
>
" style="text-decoration:none">
" id="CAPTION_<%=rsElenco("ID_ARTICOLO")%>" width="180" height="270" border="0" title="<%=rsElenco("DESCRIZIONE")%>"/>
"><%=rsElenco("DESCRIZIONE")%>
<% 'RIGA A CAPO + VISUALIZZAZIONE RIGA DI SEPARAZIONE
If cInt(rsElenco.recordcount) > 5 then
If cInt(CONTA_RISULTATI) = 5 AND NOT cInt(rsElenco.recordcount) = cInt(CONTA_ARTICOLI) then
response.Write("") & chr(13) & chr(10)
CONTA_RISULTATI = 0
end if
end if
'AGGIORNO LE VARIABILI PER IL CICLO SUCCESSIVO SPACE_RIGHT="" CONTA_RISULTATI=c Int(CONTA_RISULTATI)
+ 1 CONTA_ARTICOLI=c Int(CONTA_ARTICOLI) + 1 'CHIUDO IL CONTROLLO SU RSPREZZO RECORDCOUNT
rsPrezzo.Close
Set rsPrezzo = nothing
Set cmd_sp_ESHOP_Article_Sheet = nothing
'PROSEGUO IL CICLO DEGLI ARTICOLI rsElenco.Movenext loop rsElenco.Movefirst end if 'CHIUDO IL CONTROLLO SU RSELENCO RECORDCOUNT
rsElenco.Close
Set rsElenco = nothing
Set cmd_sp_ESHOP_Search_Article = nothing
%>
<%=Label(4,LOGIN_LINGUA)%>. <%=rsElenco("CODICE_ARTICOLO")%>
<% If isNull(rsPrezzo("SCONTO_TIPOLOGIA")) then response.Write(""&formatCurrency(cCur(rsPrezzo("PREZZO_VENDITA")),2)&"") else response.Write(""&formatCurrency(cCur(rsPrezzo("PREZZO_VENDITA")),2)&" "&formatCurrency(cCur(rsPrezzo("PREZZO_PAGATO")),2)&"") If cInt(rsElenco("PRENOTABILE")) = 1 then response.Write("
"&Label(38,LOGIN_LINGUA)&"") %>
<% If isNull(rsPrezzo("SCONTO_TIPOLOGIA")) then response.Write(""&formatCurrency(cCur(rsPrezzo("PREZZO_VENDITA")),2)&"") else response.Write(""&formatCurrency(cCur(rsPrezzo("PREZZO_VENDITA")),2)&" "&formatCurrency(cCur(rsPrezzo("PREZZO_PAGATO")),2)&"") If cInt(rsElenco("PRENOTABILE")) = 1 then response.Write("
"&Label(38,LOGIN_LINGUA)&"") %>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
AA |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments