question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance of fsfile.tests

See original GitHub issue

In fsfile tests. Every test takes at least 1000ms ts.CreateProgram took almost time(about 1000 ms)

            let options = jsOptions<Ts.CompilerOptions>(fun o ->
                o.target <- Some ScriptTarget.ES2015
                o.``module`` <- Some ModuleKind.CommonJS
            )
            let setParentNodes = true
            let host = ts.createCompilerHost(options, setParentNodes)
            ts.createProgram(ResizeArray tsPaths, options, host)

After published ts2fable online version, I found we can create a single ts program with almost empty host for simple generation (100ms)

    let host =  jsOptions<CompilerHost>(fun o ->
        o.getSourceFile <- fun fileName -> if fileName.StartsWith "module" then Some sourceFile else None
        o.writeFile <- fun (_,_) -> ()
        o.getDefaultLibFileName <- fun _ -> "lib.d.ts"
        o.useCaseSensitiveFileNames <- fun _ -> false
        o.getCanonicalFileName <- id
        o.getCurrentDirectory <- fun _ -> ""
        o.getNewLine <- fun _ -> "\r\n"
        o.fileExists <- fun fileName -> inputFileName = fileName
        o.readFile <- fun _ -> Some ""
        o.directoryExists <- fun _ -> true
        o.getDirectories <- fun _ -> ResizeArray [] 
    )

    let program = ts.createProgram(ResizeArray [inputFileName], options, host)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
humheicommented, Jul 20, 2018

image After refactor the codes All tests passed in 1s Later i will send a PR

0reactions
humheicommented, Jul 20, 2018

Currently ts2fable online is manually published.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exploring "io/fs" to Improve Test Performance and Testability
In this article I will present the tests in the form of a benchmark. This will allow us to compare the performance of...
Read more >
Is there a tool for testing the performance of reading ...
This "microbenchmark" approach allows testing single functions with multiple threads/iterations/input data and reports the trends.
Read more >
How do ulimit -n and /proc/sys/fs/file-max differ?
The ulimit is enforced on a process level, which can be less than the file-max . There is no performance impact risk by...
Read more >
WinFsp Performance Testing
This document presents results from performance testing of WinFsp. ... The "File Tests" chart summarizes performance of file path namespace ...
Read more >
Low Level Performance Testing for Object Storage
While the ultimate goal of our performance testing is to verify object storage performance for GET and PUT operations, we always start by ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found