Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.
This repository was archived by the owner on Mar 28, 2019. It is now read-only.

Slow performances on large input test files. #16

@ritesh-nitw

Description

@ritesh-nitw

Your codejudge-compiler is very slow, if the input test files is around 10 MB. Its quite faster for the small test files(1 MB-2 MB), however the judge becomes very slow for large inputs. For 10 MB input files, i remember i have to wait 10 mins to get a judge verdict.

I went through your code, and changing one line , made the judge amazingly fast.The 10 minutes waiting time got reduced to 5 sec (Isn't it amazing - 1000x times faster) - In codejudge-compiler/src/codejudge/compiler/RequestThread.java file: Don't use + operator for concatenating lines. Instead take a string builder and concatenate lines using Java inbuilt 'append' function and at last convert the string builder to string(the return type of the function).

Further optimization:

Try to use Java as much as possible, as Java is 4x times faster than PHP. For example, try to compare the expected and user output only in Java, instead of receiving the entire user program output through socket and comparing it with official output in PHP.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions