I am reading 8MB svg and it takes 30 seconds to parse. When profiling with VerySleepy I found it's because of svg__addShape adds new shape to the tail of the list. Tail is not cached so this operation is very slow. When I changed it to add it to the list's head (no iteration) parsing time went down to 1s! The speedup is too big to ignore so I think the code should be changed. If you still want to have list of shapes in correct order you can reverse the list at the end of parsing.
I am reading 8MB svg and it takes 30 seconds to parse. When profiling with VerySleepy I found it's because of svg__addShape adds new shape to the tail of the list. Tail is not cached so this operation is very slow. When I changed it to add it to the list's head (no iteration) parsing time went down to 1s! The speedup is too big to ignore so I think the code should be changed. If you still want to have list of shapes in correct order you can reverse the list at the end of parsing.