Closed ChrisCummins closed 1 year ago
@ChrisCummins, based on the comment, we rely on the user to pass the content of the source file inlined, correct?
@ChrisCummins, based on the comment, we rely on the user to pass the content of the source file inlined, correct?
I'm imagining the UI for this would be an "Upload" button that would pull up a native local file selector. Selecting a file would then read the contents so that it can set the benchmark_source
and benchmark
attributes for future requests. Is that do-able?
Cheers, Chris
@ChrisCummins, based on the comment, we rely on the user to pass the content of the source file inlined, correct?
I'm imagining the UI for this would be an "Upload" button that would pull up a native local file selector. Selecting a file would then read the contents so that it can set the
benchmark_source
andbenchmark
attributes for future requests. Is that do-able?Cheers, Chris
We'll definitely need a list of whitelisted files extensions to cross check users upload a readable file from the UI. I've used the FileReader
api *see in the past for this. But never with .c
or .ll
. But I imagine this can be do-able, we can test.
We'll definitely need a list of whitelisted files extensions to cross check users upload a readable file from the UI. I've used the
FileReader
api *see in the past for this. But never with.c
or.ll
. But I imagine this can be do-able, we can test.
File reader api looks good! As long as you can read the file contents into a string, the backend can figure out how to handle the string by the file extension. I don't know if an allow-list in the frontend would help
Cheers, Chris
This adds a
benchmark_source
attribute to the step API that enables users to provide their own code to use as a benchmark. To use your own benchmark source, you inline the contents of your source file into thebenchmark_source
attribute and set thebenchmark
attribute to the name of the local file:The file name is important because we use the file extension to determine how to process it (e.g.
.c
files are compiled,.ll
files are interpreted as bytecode, etc).Here are two example files for testing.
The first is
example1.c
:The second is
example2.ll
: