js1k

Is it possible to make Google Closure compiler *not* inline certain functions?

一曲冷凌霜 提交于 2020-01-22 12:33:03
问题 Closure compiler is inlining a function, but the code size is smaller if that function is not inlined (I only care about code size - this is for JS1k). Can I tell the compiler that I don't want that function inlined? Edit: Just to explain a bit better, here's my function: function lineTo(x,y) { a.lineTo(x,y); } where a in the canvas context. Because there are so many a.lineTo s in the code, having this function used is worth it. Like this, my code is 1019 bytes (and all the lineTo s are

Is it possible to make Google Closure compiler *not* inline certain functions?

旧城冷巷雨未停 提交于 2020-01-22 12:31:59
问题 Closure compiler is inlining a function, but the code size is smaller if that function is not inlined (I only care about code size - this is for JS1k). Can I tell the compiler that I don't want that function inlined? Edit: Just to explain a bit better, here's my function: function lineTo(x,y) { a.lineTo(x,y); } where a in the canvas context. Because there are so many a.lineTo s in the code, having this function used is worth it. Like this, my code is 1019 bytes (and all the lineTo s are

Is it possible to make Google Closure compiler *not* inline certain functions?

别等时光非礼了梦想. 提交于 2020-01-22 12:31:28
问题 Closure compiler is inlining a function, but the code size is smaller if that function is not inlined (I only care about code size - this is for JS1k). Can I tell the compiler that I don't want that function inlined? Edit: Just to explain a bit better, here's my function: function lineTo(x,y) { a.lineTo(x,y); } where a in the canvas context. Because there are so many a.lineTo s in the code, having this function used is worth it. Like this, my code is 1019 bytes (and all the lineTo s are

Is it possible to make Google Closure compiler *not* inline certain functions?

蓝咒 提交于 2019-12-03 07:50:07
Closure compiler is inlining a function, but the code size is smaller if that function is not inlined (I only care about code size - this is for JS1k ). Can I tell the compiler that I don't want that function inlined? Edit: Just to explain a bit better, here's my function: function lineTo(x,y) { a.lineTo(x,y); } where a in the canvas context. Because there are so many a.lineTo s in the code, having this function used is worth it. Like this, my code is 1019 bytes (and all the lineTo s are replaced by a.lineTo ). If I change the function to: function lineTo(x,y) { a.lineTo(x,y); console.log(); }