LaihoE / demoparser

Counter-Strike 2 replay parser for Python and JavaScript
MIT License
249 stars 29 forks source link

parsePlayerInfo performance #154

Open ChetdeJong opened 3 months ago

ChetdeJong commented 3 months ago

Hi,

I'm trying to get players info from number of demos with parsePlayerInfo However I noticed it's much less performant, than parsing some event say round_announce_match_start and then one tick from it, to get the same data.

I'm not sure if there's issue with parser or just it is what it is.

This is the result I get when parsing 44 demos:

parsePlayerInfo: 13.306s parseEventAndTick: 6.574s

I'm running JS script on 6 worker threads and demos are on SSD.

Script: demoParserTest.zip

LaihoE commented 3 months ago

Ah you are right, the parsePlayerInfo is unreasonably slow. This could be fixed but my plan is to move away from these separate functions into simple game events. So you would use something like "player_connect" event in the future.