我的应用程序使用具有有限数量请求的API从另一台服务器接收数据.数据变化很少,但即使刷新页面后也可能需要.
如果我使用SQLite ODBC Driver,如何在Delphi中使用加密到SQLite DB .
我必须使用ADO组件进行数据访问.
我有很多元素和mousemove方法,当选择一个项目时会重绘画布.
function redraw(ctx) { // ctx - canvas context
if (!needRedraw)
return;
ctx.save();
ctx.clearRect(0, 0, w, h);
drawItems(ctx);
ctx.restore();
}
function drawItems(ctx) {
var l = nodes.length(); // array of elements for drawing (from 100 to 100000)
for(var i = 0; i < l; i++) {
var item = nodes[i];
ctx.beginPath();
ctx.strokeStyle = colors(item.type);
ctx.fillStyle = fill(item);
ctx.arc(item.x, item.y, item.r, 0, Math.PI * 2, true);
ctx.fill();
ctx.stroke();
ctx.closePath();
}
}
Run Code Online (Sandbox Code Playgroud)
如何优化这个过程,因为它贯穿了这个非常昂贵的所有元素?可能是使用异步方法,但我不明白如何应用他?
javascript ×2
ado ×1
canvas ×1
cookies ×1
delphi ×1
encryption ×1
html5 ×1
html5-canvas ×1
odbc ×1
sqlite ×1
web-storage ×1