Equibit / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

Block display takes too long #49

Open macterra opened 5 years ago

macterra commented 5 years ago

The block display seems to take ~100ms per txn, e.g. 8.3s, 37.6s and 105.4s for blocks with 73, 434, 1193 txns respectively.

GET /block/000000000066fb2f115344b56b609c73e9a77dfd8b0429ab661c4187e4ba8dde 200 8354ms - 34.87kb
GET /block/000000000044b0a410d655d44ce6ea0323fc5bff7b99c1aeacf24f61b829950b 200 37595ms - 165.3kb
GET /block/00000000004610a5a16c9ee360701ce9211331fc8986a5d792a67d5f557d5cfb 200 105493ms - 439.79kb

I see in the npm logs that it is calling getrawtransaction for each txn which is not necessary given it is only showing txn id in the block display.

GET /api/getrawtransaction?txid=0b02803ec1ae5407d4584774dec197306ee5442651c1701cb732cb7568009658&decrypt=1 200 18ms - 2.29kb
GET /api/getrawtransaction?txid=a39edd891eece83002c04640764371f4cd9e286c822f6a620fe2549efd89b05c&decrypt=1 200 23ms - 2.29kb
GET /api/getrawtransaction?txid=0068567775756c8d51377b01e4f8ef1dfa37e09b2e4eda519d5c16ba6bb0a583&decrypt=1 200 19ms - 2.3kb
GET /api/getrawtransaction?txid=0c3eeea2d723aae5e447b92f99d75197023589a50679797fa07c6928b551049b&decrypt=1 200 25ms - 1.65kb
GET /api/getrawtransaction?txid=40d50b195788fc0b769fe613a3f90be43cc71a336cd27e857aab2be11b1449ee&decrypt=1 200 19ms - 2.3kb
GET /api/getrawtransaction?txid=6b5b288d8a3a68f3d03e3db6db0d286d8c2c95e529e18012a5886e4180f76099&decrypt=1 200 25ms - 1.65kb
GET /api/getrawtransaction?txid=21bc596080d1a622a179befbcb5d8baaf3c10301134c828ebfc9e8ce59ff6d02&decrypt=1 200 17ms - 2.3kb
GET /api/getrawtransaction?txid=d17b6eb897f7c141b09ba08aeca767f697ff7d90af7f597bd575d489b26e5950&decrypt=1 200 21ms - 1.65kb
GET /api/getrawtransaction?txid=96a2a1731f07044f2749e51572effa124a7064eb584ae3398f910b42748901c5&decrypt=1 200 17ms - 2.3kb
GET /api/getrawtransaction?txid=1ef373eaf75506450b928238a67017f8dd4defaefb96e2939fc5756430613e94&decrypt=1 200 20ms - 1.65kb
GET /api/getrawtransaction?txid=879c664ed70d1e83555826f139fdb28afd25548885001d1c321f29efc2aa1808&decrypt=1 200 13ms - 2.29kb
GET /api/getrawtransaction?txid=a12cfb4bb498062def3ba7c42ebc37c5d834df28d56a0c23e3d16c6cc13b1272&decrypt=1 200 16ms - 1.65kb
GET /api/getrawtransaction?txid=b6a1f264d2442deea2718e26c627699633b10935e76577de6ef3a4e513cadd93&decrypt=1 200 18ms - 2.3kb
GET /api/getrawtransaction?txid=886c737ba65539085a490ae16631ff01a12ff0971bcfd10720f12d31e52cd1a3&decrypt=1 200 24ms - 2.3kb
GET /api/getrawtransaction?txid=86ff0285e5c4d53b416c897063c8ca477e0cfebce6fcfa35dea2e2704f6da900&decrypt=1 200 16ms - 2.29kb
GET /api/getrawtransaction?txid=d79d89e5b08a89c1ac36c90a8dd86172106121604c47def2156358351a63cb71&decrypt=1 200 21ms - 1.65kb
GET /api/getrawtransaction?txid=675d140e9f2872046b3953cc5d3707340670a6392eaa80925e66b1611e672363&decrypt=1 200 14ms - 1.65kb
GET /api/getrawtransaction?txid=0d479b5b1cddb748f4134bf9c139d8cf4457b2b4569e279a1fc03643f86c7cc1&decrypt=1 200 22ms - 2.29kb