=============================================================================
【Problem】
http://php80ub20.solar.lan/phpkobo/website/public_html/mod/ETOBF/v1.48/demo/demo.html
のデモが遅い。
-----------------------------------------------------------------------------
HObfusをキャシュしてみたが、変わらない。
ETObfの実行をDomContentLoadedの１０秒後にしてみたが、やはり変わらない。
つまり、時間がかかっているのは、etobfのロード時の実行である。
/////////////////////////////////////////////////////////////////////////////
etobfのロード時の中でも「CJsObjShield_shift」で時間がかかっている。

CJsObjShield_shiftがOnの場合は、Offの場合の、
スクリプトのロード＆実行時間が１００倍になる。
==================
CJsObjShield_shift
==>Off
------------------
4.7
7.9
7.9
5.8
9.7
5.0
7.0
5.6
6.8
7.3
------------------
Ave 6.7ms
==================

==================
CJsObjShield_shift
==>On
------------------
590
609
599
617
622
605
598
605
603
606
------------------
Ave 605.4ms
==================

/////////////////////////////////////////////////////////////////////////////
「CJsObjShield_shift」の中でも以下の部分で時間がかかっている。
-----------------------------------------------------------------------------
console.time("shifting");
//@@ iterate through each character of txt
for($_idx=$_zero;$_idx<$_txt["length"];$_idx++){

	//@@ n = asc( txt[idx] )
	$_n=$_txt["charCodeAt"]($_idx);

	//@@---------------------------------------------------------------------------------------
	//@@ result += chr( n<32 or 126<n ? n : ((n - n_min + n_div) - shift_value) % n_div + n_min
	//@@---------------------------------------------------------------------------------------
	//@@ If n is less than 32 or more than 126, don't change the value
	//@@ Otherwize, shift the value.
	$_result+=$_String["fromCharCode"]((($_n<@n_min@)||(@n_max@<$_n))?$_n:((($_n+@n_div@-@n_min@)-$_shift_value)%@n_div@+@n_min@));
}
console.timeLog("shifting");
console.log($_result.length);
-----------------------------------------------------------------------------

/////////////////////////////////////////////////////////////////////////////
-----------------
598 ms
27104 bytes
-----------------
598 msは、0.6秒だ。もたつき感の元になる。
(scrample [A] は平均1.8ms と scrample [B] は平均1.25ms。)

ちなみにHObfusにも「CJsObjShield_shift」はあるが、shiftingでは以下の結果をだす。
-----------------
182 ms
16921 bytes
-----------------
サイズは半分ではないのに、時間は1/3以下になっている。

HObfusのHTMLのObfuscationには、Map型のCaesar-Cipherをおこなっている。
ただし、callbackを使用したreplace(ch=>map[ch]) は使っておらず、("replace-and-callback")
forループでmapをおこなっている。("replace-in-loop")

-----------------------------------------------------------------------------
【Solution】
(1) ETObfの「CJsObjShield_shift」ではshiftingを省く。
(2) HTObfusの「CJsObjShield_shift」ではshiftingには、mappingに書き換える。
(3) HTObfusでの、HTMLのCaesar-Cipherはすでにmap型なので変更の必要はない。
	"replace-and-callback"方式で、"replace-in-loop"ではないが、
	両者に大きなスピードの違いはない。
	詳細: my-projects/etobf/ETOBF-148/public_html/research/efficent-Caesar-Cipher/task.php
=============================================================================
