The possibility to speed up UTM SE by WKWebView.
JIT is not allowed in iOS, but the javascript engine itself is JIT enabled.
I found a project called jslinux, which is basically run qemu in browser engine, which enables JIT technology I think.
And I write a simple python benchmark, test it on jslinux and UTM SE
This is jslinux running in Google Chrome in iOS 17:
This is UTM SE downloaded from App store:
The jslinux(32s) is faster than UTM SE(62s).
Although the cpu architecture is different(risc-v/aarch64), so that the result is not direct comparable.
But I'm curious do we have the possibility to speedup UTM SE by running qumu in the WKWebView in iOS?
The script:
#!/usr/bin/python3
#Python CPU Benchmark by Alex Dedyura (Windows, macOS, Linux)
import time
import platform
import subprocess
print('Python CPU Benchmark by Alex Dedyura (Windows, macOS(Darwin), Linux)')
print('Arch: ' + subprocess.run(['uname', '-a'], capture_output=True, text=True).stdout,end="")
print('Python: ' + platform.python_version())
print('\nBenchmarking: \n')
start_benchmark = 100 # The number of iterations in each test
repeat_benchmark = 0 # The number of repetitions of the test
max_repeat_benchmark = 10 # The number of repetitions of the test
max_time = 12
# Initializing a variable to accumulate execution time
total_duration = 0
start_s = time.perf_counter()
# Starting the test cycle
for attempt in range(max_repeat_benchmark):
repeat_benchmark += 1
start = time.perf_counter() # Recording the initial time
# Nested loops for performing calculations
for i in range(start_benchmark):
for x in range(1, 1000):
3.141592 * 2 ** x # Multiplying the number Pi by 2 to the power of xx
for x in range(1, 10000):
float(x) / 3.141592 # Dividing x by Pi
for x in range(1, 10000):
float(3.141592) / x # Dividing the number Pi by x
end = time.perf_counter() # Recording the end time
duration = round(end - start, 3) # Calculate and round up the execution time
total_duration += duration # Adding the execution time to the total amount
print(f'Time: {duration}s') # We output the execution time for each iteration
if total_duration > max_time:
break
# Calculate and output the average execution time
average_duration = round(total_duration / repeat_benchmark, 3)
print(f'Average (from {repeat_benchmark} repeats): {average_duration}s')
This is genuinely a smart idea.
This was looked into before and I think it's just too much work to integrate. If someone volunteers to make a fork, we will maintain it when it works. This was how UTM SE came into being.
it‘s a great idea
As I know, JSCore does not allow JIT on iOS, iPadOS still now. https://forums.developer.apple.com/forums/thread/746159
https://x.com/seanistethered/status/1904946905781596201?s=46
Thanks for the info. I achieved it on device without any JIT enabler nor internet. It works flawlessly and ur theory is true. It is 100% possible.
Now I will try to modify the root and add NFS and I gonna run a NFS server that points to the Document container of the app
Root = Root of Linux session