code-narrator icon indicating copy to clipboard operation
code-narrator copied to clipboard

Code narrator is *very* slow, does seemingly nothing

Open hugo4711 opened this issue 3 years ago • 2 comments

In my react project, code-narrator runs very slow and seemingly does nothing. Result after around 15 minutes:

 % npx code-narrator          
Starting code-narrator
Asking about Configuration using template what_are_config_files for builder Configuration
Received answer for Configuration
Asking about package.json using template app_config for builder Configuration
Warning - Content to long: I had to trim a file, only using first 3410 character
Received answer for package.json
Asking about tsconfig.json using template app_config for builder Configuration
Received answer for tsconfig.json
Asking about tslint.json using template general_config for builder Configuration
Received answer for tslint.json
Asking about Configuration using template gpt_question for builder Configuration
Warning - Content to long: I had to trim a file, only using first 3410 character
Received answer for Configuration

hugo4711 avatar Apr 28 '23 23:04 hugo4711

Yes, it is super slow.

It's basically the time it takes for gpt-4 to answer. It is processing according to the log you posted, when you see "Received answer for XXXX", it has received answer from gtp-4

For code-narrator it took some 45-60 minutes to generate the whole documentation

If you open .code-narrator/cache.json you will see what has happened. The documentation property of the json is the .md response that will be stored on disk when the query of all files are done

ingig avatar Apr 29 '23 12:04 ingig

@hugo4711 I pushed a new version, 1.0.11.

Two main things.

  • You see the time of the query starting and when you get the response. Maybe you can estimate the total time from that.
  • Generate the documentation immediately after a response. Then you don't have to wait for all the files to be processed before seeing some documentation. Hopefully fixes that "does seemingly nothing" :)

You can kill the process if you are running it and restart it, it will start where it left off and won't reprocess files it has already processed

Btw. didn't notice that you said it took 15 minutes for those 5 requests, that is about 3 minutes per query. I have been seeing 30-120 seconds on queries, it all depends on the size of the file

ingig avatar Apr 29 '23 13:04 ingig