You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
ToJSCode method uses a very inefficient way of concatenating strings: it uses += operator. For "toy" strings this is ok, but when strings get very large, this method takes an excruciatingly long amount of time (hours) to complete. Fortunately, it is easily fixable: put all sub-strings into a list and return a join of them at the end of the function.
Python uses C-style strings: concatenating them with + operator is extremely inefficient since it takes time just to find the end of the string (\0 character) where the concatenation should take place. This is why ''.join(some_list) is much (orders of magnitude) faster than concatenating with + operator.